File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Extended ASCII characters

 
Manish Malik
Greenhorn
Posts: 19
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Post the code that you used to play with the unicode.
 
Manish Malik
Greenhorn
Posts: 19
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 8521
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 19
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic