my dog learned polymorphism*
The moose likes Java in General and the fly likes characters to unicode Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "characters to unicode" Watch "characters to unicode" New topic
Author

characters to unicode

yo nara
Ranch Hand

Joined: Apr 03, 2002
Posts: 35
Is there any java code snippet to which if i pass any letter from any language converts to unicode?
native2ascii does so but besides that?
thnx in advance.
Surasak Leenapongpanit
Ranch Hand

Joined: May 10, 2002
Posts: 341
hi
You can get char array from String and convert them to unicode using >>> operator each byte of char.
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Originally posted by surasak lee:
You can get char array from String and convert them to unicode using >>> operator each byte of char.
Really? Could you explain how this works (I don't mean the sign-bit preserving shift but the Java char <-> Unicode character byte representation relationship)?


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: characters to unicode
 
Similar Threads
Differences between FileInputStream FileReader
Unicode Standard on IBM WSAD 5.1
Character Set for Arabic and English
Unicode char
Conversion