I'm working with International Phonetic Alphabet (IPA) symbols in my Python program, a rather strange set of characters whose UTF-8 codes can range anywhere from 1 to 3 bytes long. This thread from several years ago basically asked the reverse question and it seems that ord(character)
can retrieve a decimal number that I could convert to hex and thereafter to a code point, but the input for ord()
seems to be limited to one byte. If I try ord()
on any non-ASCII character, like ɨ
for example, it outputs:
TypeError: ord() expected a character, but a string of length 2 found
With that no longer an option, is there any way in Python 2.7 to find the Unicode code point of a given character? (And does that character then have to be a unicode
type?) I don't mean by just manually looking it up on a Unicode table, either.