Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
10
Task/UTF-8-encode-and-decode/11l/utf-8-encode-and-decode.11l
Normal file
10
Task/UTF-8-encode-and-decode/11l/utf-8-encode-and-decode.11l
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
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)))
|
||||
Loading…
Add table
Add a link
Reference in a new issue