aspose file tools
The moose likes Java in General and the fly likes how to know the unicode coding for a specific char Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "how to know the unicode coding for a specific char" Watch "how to know the unicode coding for a specific char" New topic
Author

how to know the unicode coding for a specific char

Hussein Baghdadi
clojure forum advocate
Bartender

Joined: Nov 08, 2003
Posts: 3400

Hi all.
how can I get the unicode coding for a specific char.
something like (for example):
A = \u2302
c = \u233a
is there an algorithm to apply here ?
Mike Stepp
Greenhorn

Joined: Jul 02, 2004
Posts: 3
The unicode is in hex, so you just need to convert your char to hex, then write out "\u####". You could do this:

"\u"+Integer.toHexString((int)mychar);

(this might actually require some padding 0's on the left, but you get the idea).
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Windows only: run the "charmap" utility.

(BTW: what are you trying to achieve here - code point values don't change so isn't this a little unecessary? Sorry if that sounds like a criticism - I'm just curious)
[ July 05, 2004: Message edited by: Paul Sturrock ]

JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Jim Yingst
Wanderer
Sheriff

Joined: Jan 30, 2000
Posts: 18670
You may also find useful info at http://www.unicode.org/charts/ .


"I'm not back." - Bill Harding, Twister
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: how to know the unicode coding for a specific char
 
Similar Threads
system dependent representation of chars
how to use unicode char?
Convert char to unicode
java coding and unicode
Unicode