Reputation: 2535
Need your help. I have an annoying issue: thai symbols can't be printed pretty in Netbeans 7.2 output window:
Output after System.out.println(...); ???????????????????[TH_WORD]
I changed netbeans.conf as mentioned, it doesn't help; I changed project properties->Sources encoding to UTF-8 and sources looks good, all thai symbols in sources are correctly printable. But how to change settings of NB output window?
Windows 7 64bit, Netbeans 7.2 (I run NB as "C:\Program Files (x86)\NetBeans 7.2\bin\netbeans64.exe" --locale en_US)
Upvotes: 1
Views: 4857
Reputation: 2872
For Azerbaijani language I tried this:
System.setOut(new PrintStream(System.out, true, "UTF8"));
into my code. After this correction it changed ? marks into different symbols. The word tədarük before displayed as t?dar?k. But now it standed tЙ™darГјk-Dfile.encoding=utf-8
into the Run arguments on Project properties, no way-Duser.language=az
, result was the sameMonospaced
font into Arial
, nothing changedIt did not help. Only after changing Netbeans config it worked. I opened netbeans.conf, in my case it was in C:\Program Files\NetBeans 7.4\etc folder, on linux it'll /usr/local/netbeans-7.4/etc/netbeans.conf
I added -J-Dfile.encoding=UTF-8
into the end of netbeans_default_options
just before the quotation mark. Restarted NetBeans. Now it works even with Monospaced
font and without setting -Duser.language
param.
So I needed only two things.
-J-Dfile.encoding=UTF-8
into netbeans_default_options
in
netbeans.conf System.setOut(new
PrintStream(System.out, true, "UTF8"));
Upvotes: 2
Reputation: 363
you can add system variable in mycomputer
JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF8
Upvotes: 0
Reputation: 2535
Solved thanks to conversation Java: How to detect (and change?) encoding of System.console?
The solution was founded and applied:
PrintStream out = new PrintStream(System.out, true, "UTF-8");
use appropriate import java.io.*, indeed.
Upvotes: 2
Reputation: 86774
The solution will be to change the font being used for the console output window to one that includes Thai characters. In Eclipse this is possible in the Preferences dialog. It's been at least 5 years since I used NetBeans, but I'm 99% certain something similar is available there too.
Upvotes: 0