Python has an escape sequence \u
to display unicode values. However this is restricted to only 16 bit unicode values. That is
>>> '\u1020'
'ဠ'
Whereas 32 bit uncode values do not work. That is
>>> '\u00001000'
'\x001000'
Which is obviously wrong. The python documentation mentions
The escape sequence \u0020 indicates to insert the Unicode character with the ordinal value 0x0020 (the space character) at the given position.
The python How To Unicode clearly mentions the use of '\U'
to represent 32-bit unicode sequences.
>>> "\u0394" # Using a 16-bit hex value
'Δ'
>>> "\U00000394" # Using a 32-bit hex value
'Δ'
In this case
>>> '\U00001000'
'က'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With