Re: How can I get the Unicode number (0xABCD) from the character ?

Hye-Shik Chang <[email protected]> Fri, 16 Jul 2004 13:08:03 +0900
Newsgroups gmane.comp.python.internationalization
Message-ID <[email protected]>
Posadas, Dennis wrote:
> Hi All,
>        
>         What is the command in python that would allow me to get the unicode number (0xABCD) of a given unicode character.
> 
> Let's say I had '-' and wanted to get 0x4E00, how would I do it ?


>>> hex(ord(u'\u4e00'))
'0x4e00'
>>> import unicodedata
>>> unicodedata.name(u'\u4e00')
'CJK UNIFIED IDEOGRAPH-4E00'


Hye-Shik