Unicode code point

In this section, we are going to learn about the unicode code point. Python has a powerful built-in function named ord() to get a Unicode code point from a given character. So, let's see an example of getting a Unicode code point from a character, as shown in the following code:

>>> str1 = u'Office'
>>> for char in str1:
... print('U+%04x' % ord(char))
...
U+004f
U+0066
U+0066
U+0069
U+0063
U+0065
>>> str2 =
>>> for char in str2:
... print('U+%04x' % ord(char))
...
U+4e2d
U+6587

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset