myeclipse 中的'ISO-8859-1'编码问题: 在eclipse中创建tomcat project工程后,在创建的jsp文件中若包含中文,当保存文件时,会弹出提示框,并使保存失败。提示框的内容为:''Some characters cannot be mapped using 'ISO-8859-1' character encoding. Either changethe encoding or remove the characters which are not supported by the 'ISO-8859-1' character encoding." ,
在网上查了一下解决办法,找到3条:
1:在文件开头增加<%@page pageEncoding="GBK"%>
2:应该使用eclipse的jinto插件编辑,会自动调用java的native2ascii把文件转码。jinto插件下载:http://www.guh-software.de/jinto.html
3:在eclipse --> window --> Preferences --> General --> Content Types --> Test -->
单击 Java Properties File,在底部出现 'Default edcodng:',改成GBK,然后update. 虽然能保存,但还必须利用 native2ascii 来转换一下,不然输出还是乱码。
第一条我试过,问题解决;后两条未试验,^-^.
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/7761364/viewspace-916448/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/7761364/viewspace-916448/