11 lines
368 B
Text
11 lines
368 B
Text
|
|
F unicode_code(ch)
|
|||
|
|
R ‘U+’hex(ch.code).zfill(4)
|
|||
|
|
|
|||
|
|
F utf8hex(ch)
|
|||
|
|
R ch.encode(‘utf-8’).map(c -> hex(c)).join(‘ ’)
|
|||
|
|
|
|||
|
|
print(‘#<11 #<15 #<15’.format(‘Character’, ‘Unicode’, ‘UTF-8 encoding (hex)’))
|
|||
|
|
V chars = [‘A’, ‘ö’, ‘Ж’, ‘€’]
|
|||
|
|
L(char) chars
|
|||
|
|
print(‘#<11 #<15 #<15’.format(char, unicode_code(char), utf8hex(char)))
|