UTF-8 encode and decode: Difference between revisions

Content added Content deleted
m (Update to supported Julia 1.x (tested in 1.8.5), also works in 0.6)
imported>Arakov
Line 2,519: Line 2,519:


=={{header|Elena}}==
=={{header|Elena}}==
ELENA 4.x :
ELENA 6.x :
<syntaxhighlight lang="elena">import system'routines;
<syntaxhighlight lang="elena">import system'routines;
import extensions;
import extensions;
Line 2,532: Line 2,532:
string printAsUTF8Array()
string printAsUTF8Array()
{
{
self.toByteArray().forEach:(b){ console.print(b.toString(16)," ") }
self.toByteArray().forEach::(b){ console.print(b.toString(16)," ") }
}
}
string printAsUTF32()
string printAsUTF32()
{
{
self.toArray().forEach:(c){ console.print("U+",c.toInt().toString(16)," ") }
self.toArray().forEach::(c){ console.print("U+",c.toInt().toString(16)," ") }
}
}
}
}