Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
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


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
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]
 
 
subject: characters to unicode