File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes I/O and Streams and the fly likes java command - argument question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "java command - argument question" Watch "java command - argument question" New topic

java command - argument question

hui man

Joined: Dec 17, 2004
Posts: 3
java classname [arg1] [arg2] ... where argX contains non-english characters

i am now trying to run java command with non-english characters as arguments. the args[] array i get from main() cannot show those characters (it just shows "???"). how can i change the charset of to utf8 before the program gets into main() so that i can get those characters correctly? please give me some suggestions. thanks!
Shrinivas Mujumdar
Ranch Hand

Joined: Aug 27, 2004
Posts: 328
Try to use
Locale class in java.util package
hui man

Joined: Dec 17, 2004
Posts: 3
Could you please explain a bit more?
public static void main(String[] args) {
Now, if args[0] is in Chinese, how can I display it correctly using Locale class? Thank you.
I agree. Here's the link:
subject: java command - argument question
It's not a secret anymore!