请教各位高手,我的问题是:
我在MyEclipse里New了一个Web Project,在src下New了一个beanTest.java的类,但是在这个类里面加了中文字符的注释,如://测试;或者输出字符串为中文时,都会报错,大概意思就是不能保存中文字符,信息如下:
Save could not be completed.
Reason:
Some characters cannnot be mapped using "Cp1252 " character encoding.Either change the encoding or remove the characters which are not supported by the "Cp1252 " chaaracter encoding.
不知道是什么原因,我在这个类名点右键的Properties> > Info里,选择UTF-8也不行,还请高手们帮我解决一下,谢谢
------解决方案--------------------
关注
------解决方案--------------------
你试一下改myeclipse的系统默认编码吧,怀疑是默认成西文了
------解决方案--------------------
编码问题: 在 WEB PROJECT 中右键 properties 中设置一下 Text file encoding 选择 Inherited from container(GBK)試試看
------解决方案--------------------
preferrence-> Myeclipse-> Editors-> JSP,选编码类型为UTF-8或者GBK,另外所有其他和MyEclipse相关的编辑器的编码方式也都是在那里修改的
------解决方案--------------------
windows-> preferrence-> General-> Editors
看看Text file encoding 默认的编码方式是不是GBK?
------解决方案--------------------
对。楼上的方法我试了,是对的,我在Eclipse3.2中为windows-> preferrence-> General-> workspace里的text file encoding变成默认的就ok