encoding problem of Console

I use the j2se 1.4.2_05-b04, and met a problem.

the code is as follow, I have encoded the source code with UTF-8

OutputStreamWriter ow = new OutputStreamWriter(System.out,"UTF-8");

System.out.println(ow.getEncoding());

ow.write(" ?);

ow.flush();

ow.close();

I got the result:

UTF8

莽鈥� 鈥� 鈥�

鈥� 鈥�

--

then I changed it with

OutputStreamWriter ow = new OutputStreamWriter(System.out);

...

the result:

GBK

?

-

the encoding of ISO-8859-1 was even worse:

ISO8859_1

�? ? ? ? ?

-

It made no difference even after add System.setProperty("file.encoding",

"UTF-8");

How can I get the Latin letter printed proper on console

[855 byte] By [alienqiao] at [2007-9-30 20:41:29]
# 1
I can't post the snippet with proper encoding on this forum. so, please refer to the http://www.eclipse.org/newsportal/article.php?id=12514&group=eclipse.tools.jdtAnd I found it's not the fault of eclipse. Maybe System.out in jdk caused it.
alienqiao at 2007-7-7 1:30:30 > top of Java-index,Administration Tools,Sun Connection...
# 2

As described I doubt this has anything to do with java.

The console (not java) has a character set. It can't display anything but those characters. Nothing you do in java is going to change that. It is very unlikely that your console is using UTF8 as it character set. And unless it is using UTF8 is will not display UTF8 correctly.

jschell at 2007-7-7 1:30:30 > top of Java-index,Administration Tools,Sun Connection...