Re: How do you extract hex value of a Unicode character ?

Discussion in 'Python' started by John Lenton, Jul 15, 2004.

  1. John Lenton

    John Lenton Guest

    On Thu, 15 Jul 2004 11:03:06 +0800, Posadas, Dennis
    <> wrote:
    > If unichr(x), where x is a value like 0x4EEE will give you the
    > character as mapped in the Unicode tables, what is the opposite of
    > this command? In other words, how do I get the 0xABCD value from the
    > character itself ?


    ord returns the ordinal of the character; if it is a unicode
    character, the unicode ordinal. In other words, ord(unichr(0xABCD)) ==
    0xABCD

    --
    John Lenton () -- Random fortune:
    bash: fortune: command not found
    John Lenton, Jul 15, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    10
    Views:
    6,112
    Neredbojias
    Aug 19, 2005
  2. Bengt Richter
    Replies:
    6
    Views:
    439
    Juha Autero
    Aug 19, 2003
  3. jack
    Replies:
    4
    Views:
    566
  4. tim

    hex string to hex value

    tim, Nov 22, 2005, in forum: Python
    Replies:
    8
    Views:
    18,769
  5. Replies:
    7
    Views:
    3,536
Loading...

Share This Page