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
精彩评论