| [news.eclipse.platform] Re: Character encoding problem (on Windows) |
myLabel.setText("TEXT IN UTF8 ENCODING");I have found the solution and am posting for other people's reference.
System.getProperty("file.encoding")1) Go to Window->Preferences->General->Content Types 2) Select "Text" at the top tree-list. 3) Specify "UTF8" in the bottom text box labeled "Default encoding". 4) Click on the "Update" button. 5) Select "Java Class File" at the top tree-list. 6) Repeat (3) and (4) 7) Click OK to save preferences. 8) Clean the project so that it is rebuilt (Project->Clean...)
Alex Blewitt wrote:
The .properties files aren't treated as UTF-8 when they're loaded. Instead, they're "escaped ASCII" with \u1234 representing unicode character 1234. You can use the 'native2ascii' converter to generate these files, though I'm not sure what you need to do to tell it that the input is UTF-8.
That's basically because the properties files are loaded with the java.util.Properties object, which uses this crappy format instead of something sensible; and hence, internationalised messages must also use the Crappy Format(TM).
Alex.