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 Unicode usage Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Unicode usage" Watch "Unicode usage" New topic
Author

Unicode usage

yo nara
Ranch Hand

Joined: Apr 03, 2002
Posts: 35
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

Joined: Dec 06, 2001
Posts: 138
You'll have to be more specific with your question if you want answers. Also post aany code that you have so far.


Pete<br />"Reality is an illusion <br />brought on by a lack of <br />drink, drugs and smut"
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
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.


[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
Dave Vick
Ranch Hand

Joined: May 10, 2001
Posts: 3244
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!!


Dave
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
You need to read up on Internationalization and Localization.


"JavaRanch, where the deer and the Certified play" - David O'Meara
yo nara
Ranch Hand

Joined: Apr 03, 2002
Posts: 35
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
 
wood burning stoves
 
subject: Unicode usage