Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
35
Task/UTF-8-encode-and-decode/8th/utf-8-encode-and-decode.8th
Normal file
35
Task/UTF-8-encode-and-decode/8th/utf-8-encode-and-decode.8th
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
hex \ so bytes print nicely
|
||||
|
||||
[
|
||||
"\u0041",
|
||||
"\u00F6",
|
||||
"\u0416",
|
||||
"\u20AC"
|
||||
]
|
||||
\ add the 0x1D11E one; the '\u' string notation requires four hex digits
|
||||
"" 1D11E s:+ a:push
|
||||
|
||||
\ for each test, print it out and its bytes:
|
||||
(
|
||||
dup . space
|
||||
b:new
|
||||
( . space drop ) b:each
|
||||
cr
|
||||
) a:each! drop
|
||||
|
||||
cr
|
||||
\ now the inverse:
|
||||
[
|
||||
[41],
|
||||
[C3,B6],
|
||||
[D0,96],
|
||||
[E2,82,AC],
|
||||
[$F0,9D,84,9E]
|
||||
]
|
||||
|
||||
(
|
||||
dup . space
|
||||
b:new >s . cr
|
||||
) a:each! drop
|
||||
|
||||
bye
|
||||
Loading…
Add table
Add a link
Reference in a new issue