I'm using debian linux and my locale is EUC-KR. When I use Korean
language in source such as printf, the character is broken in console
just showing "????".
How can I solve this problem?
It's probably a mismatch between the character encoding being used by
java, your shell, your X server, and so on.
I assume that you have a normal text editor which can happily edit text
files containing Korean characters.
First, try redirecting the console output to a file:
java PrintingProgram >test.txt
Then look at that file with your normal text editor.
If that file looks okay, then the problem is that your console is not
using the right character encoding. I don't know how you'd fix that; i
suggest you ask on a Korean linux newsgroup.
If that file looks like nonsense, then the problem is probably that java's
default character encoding is not set correctly. It may be using UTF-8 or
ISO-Latin-1 when it should be using ISO2022KR or something. Or that it's
using ISO-Latin-1 when it should be using UTF-8. Whatever, the solution is
probably to set the file.encoding system property to the name of the
appropriate character encoding when you start java.
There's probably a way to set the character encoding globally, so java
uses it as a default, but i don't know what that is.
tom