UTF-8 encode and decode: Difference between revisions
m
Update to supported Julia 1.x (tested in 1.8.5), also works in 0.6
Antoni Gual (talk | contribs) |
m (Update to supported Julia 1.x (tested in 1.8.5), also works in 0.6) |
||
Line 3:
As described in [[UTF-8]] and in [[wp:UTF-8|Wikipedia]], UTF-8 is a popular encoding of (multi-byte) [[Unicode]] code-points into eight-bit octets.
The goal of this task is to write a encoder that takes a unicode code-point (an integer representing a unicode character) and returns a sequence of
Then you have to write the corresponding decoder that takes a sequence of
Demonstrate the functionality of your encoder and decoder on the following five characters:
Line 3,161:
=={{header|Julia}}==
▲Julia supports by default UTF-8 encoding.
▲<syntaxhighlight lang="julia">for t in ("A", "ö", "Ж", "€", "𝄞")
end
</syntaxhighlight>
▲ println(dec, " → ", enc)
▲end</syntaxhighlight>
{{out}}
|