Does the Scala compiler work with UTF-8 encoded source files?

后端 未结 3 2076
星月不相逢
星月不相逢 2020-12-19 20:45

I have a very simple bit of Scala code

 var str = \"≤\"
 for( ch <- str ) { printf(\"%d, %x\", ch.toInt, ch.toInt) ; println  }
 println
 str = \"\\u2264         


        
3条回答
  •  攒了一身酷
    2020-12-19 21:24

    The Scala plugin respects the encoding settings of Eclipse. You can set the workspace default in Preferences. If that doesn't trickle down to your sources, check if there is an overriding encoding at the project or source folder level.

    Workspace Preferences

    For example, here is the property page of a source folder:

    enter image description here

提交回复
热议问题