• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Unicode usage

 
yo nara
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
suppose i want to have characters from languages other than english through my java programme.
how do i aceive this using what
import java.util.*;
class Test{
public static void main(String [] a){
char c='\u3059';
System.setProperty("file.encoding","MS932");
System.setProperty("user.language","ja");
System.setProperty("sun.io.unicode.encoding","UnicodeLittle");
}
System.out.println(c);
}
instead of printing japanese characters it print ? sign though the os is japnese .what could be the reason
[ April 05, 2002: Message edited by: yogi na ]
 
Peter Phung
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You'll have to be more specific with your question if you want answers. Also post aany code that you have so far.
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here's what I know about unicode...
Unicode Charts are available from Unicode.org.
In Java, to display a particular Unicode character, you can use the unicode escape charater '\u' followed by the code for the character you want to display. Example:
System.out.println("\u03EA");
This should ouput a Greed character, but on my system a simple '?' is displayed - probably because my system doesn't know what most Greek characters are.
If you do a search of the API documentation at The NavigationZone for unicode, you'll probably find some useful information.
Sun has a couple of useful articles (found by searching at java.sun.com for unicode). Question of the week - What is Unicode? looks promising.
Finally, the search page of Sun's java tutorials might lead you to some useful information.
Good Luck.
 
Dave Vick
Ranch Hand
Posts: 3244
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yogeshnaravane
Welcome to the Java Ranch, we hope you’ll enjoy visiting as a regular however,
your name is not in keeping with our naming policy here at the ranch. Please change your display name to an appropriate name as shown in the policy.
Thanks again and we hope to see you around the ranch!!
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to read up on Internationalization and Localization.
 
yo nara
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i want to display japanese characters using java unicode the operating system on pc is japanese
still it do not display japanese characters but prints only ? sign .how do i programme
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic