解决使用Rails中使用中文时出现"Your template was not saved as valid UTF-8"的问题

我使用NetBeans 7.1.2作为IDE,但用它编辑的erb文件中存在中文的话,访问会出现"Your template was not saved as valid UTF-8"提示。

需要在NetBeans中做如下设置:

1. 找到你的Netbeans安装目录下的etc文件夹,如C:\Program Files\NetBeans 7.1.2\etc

2. 用记事本打开netbeans.conf

3. 找到netbeans_default_options这一句

4. 在最后面加上一个空格,再加入-J-Dfile.encoding=UTF-8

然后重启NetBeans。

posted on 2012-09-13 18:43  dancetime  阅读(251)  评论(0编辑  收藏  举报

导航