Last active
February 14, 2019 02:33
-
-
Save jdhao/ee7c18265fca029a86372d59f7fea2ca to your computer and use it in GitHub Desktop.
How to show the Unicode code point of a character or show the character corresponding to a certain code point in Python 3.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# show code point in hexadecimal format, | |
# see reference https://stackoverflow.com/questions/38909362/is-there-a-way-to-find-a-characters-unicode-code-point-in-python-2-7 | |
hex(ord('我')) | |
# get the character corresponding to a code point, | |
# reference: https://stackoverflow.com/questions/10715669/python-unicode-codepoint-to-unicode-character | |
chr(0x6211) # the code point of 我 is \u6211 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment