开发者

UTF-8 in command prompt

hello i want to run java code in command prompt that read UTF-8

how can i do t开发者_如何学Gohat


fire up your java with

 java -Dfile.encoding=UTF8 <Your class Name>


There are methods in Java classes that accept a charset. See: InputStreamReader(java.io.InputStream, java.nio.charset.Charset) for instance.

http://download.oracle.com/javase/6/docs/api/java/io/InputStreamReader.html

But make sure you read Java Internationalization FAQ first, so you will understand how Java handles Unicode:

http://java.sun.com/javase/technologies/core/basic/intl/faq.jsp

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜