无效的字符常量££(从Netbeans导入到Eclipse IDE之后)

And*_*dez 2 eclipse encoding netbeans

我刚从Netbeans项目中导入了一个代码文件到Eclipse项目中.Eclipse不喜欢导入的以下代码行:

if( value == '£' ) {
Run Code Online (Sandbox Code Playgroud)

在Netbeans中,这显示为:

    if( value == '£' ) { 
Run Code Online (Sandbox Code Playgroud)

我认为这可能取决于编码.Netbeans具有"项目属性中的编码"设置,该设置设置为UTF-8.Eclipse中是否有相同的设置来绕过它?

And*_*eas 9

查看ide和文件的编码设置是否匹配.我猜你创建了文件latin编码并在eclipse中以utf-8打开它.或者转换使用了错误的字符集.

在eclipse首选项中,转到编辑和文件编码.