File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Extended ASCII characters Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Extended ASCII characters" Watch "Extended ASCII characters" New topic
Author

Extended ASCII characters

Manish Malik
Greenhorn

Joined: Jan 27, 2001
Posts: 19
I have read that Java uses UNICODE. And when I tried to put Extended ASCII characters as command line arguments to a Java program, it didn't display them correctly. Is there any way to display Extended ASCII character set in Java?
(this question may be termed as a "hurried" question, as I have myself not experimented enough before asking you people).
thanks.

------------------
Manish.


Manish
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
Post the code that you used to play with the unicode.


"JavaRanch, where the deer and the Certified play" - David O'Meara
Manish Malik
Greenhorn

Joined: Jan 27, 2001
Posts: 19
Originally posted by Cindy Glass:
Post the code that you used to play with the unicode.

You can take the example of simply using the statement:
System.Out.println(arg[1]);
where arg[1] represents a command line agrument. If you put in an extended ASCII character here, it will not display it correctly (at least on my system).

------------------
Manish.
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
Well, it took some poking around, but I finally found this fascinating disertation on the Lexical Structure of the Java Language.
http://java.sun.com/docs/books/jls/second_edition/html/lexical.doc.html
The sum of it is that the conversion between unicode and ascii is a compile time function, and it happens very early in the compiling heirarchy.
When you input a String at the command prompt there is no compiler around to translate it, there is only the JRE, so it will remain a String.
Manish Malik
Greenhorn

Joined: Jan 27, 2001
Posts: 19
Originally posted by Cindy Glass:
Well, it took some poking around, but I finally found this fascinating disertation on the Lexical Structure of the Java Language.
http://java.sun.com/docs/books/jls/second_edition/html/lexical.doc.html

Thanks for the link. Will be reading it and posting if I have any further doubts on this topic.


------------------
Manish.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Extended ASCII characters