• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Extended ASCII characters

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
"The Hood"
Posts: 8521
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Post the code that you used to play with the unicode.
 
Manish Malik
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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"
Posts: 8521
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic