Results encoding in Scala Worksheet Eclipse plugin

后端 未结 2 412
攒了一身酷
攒了一身酷 2021-01-20 12:47

How can I change charset encoding for results in the Worksheet in Eclipse?

object workbook1 {
\"cyrillic A is: \" + \"А\"  //> res0: String(\"cyrylic A is         


        
2条回答
  •  说谎
    说谎 (楼主)
    2021-01-20 13:23

    Many thanks to @Excelan's original question and solution as it definitely got me pointed in the right direction!

    I was experiencing this problem using the Scala Eclipse IDE when working with new projects I created, but was not experiencing the problem when using imported projects. Once I saw Excelan's comment about the encoding I started poking around, you can change the Eclipse default text file encoding for all projects in the Preferences like so:

     Open Preferences
     Expand the "General" menu.
     Select the "Workspace" menu.
     Change "Text file encoding" option from Default to Other and select UTF-8.
    

    Once I followed those steps, closed and reopened eclipse. Every new worksheet created after that works just fine!

    Screencap of preferences

    To change the settings on a project level, right click the project and select properties. The text file encoding is found under the "Resources" menu.

    To change the settings for a single file, right click the file and select properties. The text file encoding is found under the "Resources" menu.

提交回复
热议问题