UTF-8 encode and decode: Difference between revisions

Content added Content deleted
m (Replace deprecated functions)
Line 3,927: Line 3,927:
writeln("-------------------------------------------------");
writeln("-------------------------------------------------");
for ch range "AöЖ€𝄞" do
for ch range "AöЖ€𝄞" do
utf8 := striToUtf8(str(ch));
utf8 := toUtf8(str(ch));
writeln(ch rpad 11 <& "U+" <& ord(ch) radix 16 lpad0 4 rpad 7 <&
writeln(ch rpad 11 <& "U+" <& ord(ch) radix 16 lpad0 4 rpad 7 <&
hex(utf8) rpad 22 <& utf8ToStri(utf8));
hex(utf8) rpad 22 <& fromUtf8(utf8));
end for;
end for;
end func;</syntaxhighlight>
end func;</syntaxhighlight>