Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Results encoding in Scala Worksheet Eclipse plugin

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

object workbook1 {
"cyrillic A is: " + "А"  //> res0: String("cyrylic A is: Рђ") = cyrylic A is: Рђ
}

Editor's encoding is UTF-8. Results are printed right into editors window, but the encoding of results is different. This is in Windows.

like image 577
Excelan Avatar asked Dec 07 '25 03:12

Excelan


1 Answers

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.

like image 116
Kyle Avatar answered Dec 08 '25 20:12

Kyle



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!