ref: 5007bc86a71fb725fe586acfc0d320e8f50c22b9
dir: /test/encodechar.myr/
/* checks that we can decode and encode characters from a utf8 string. */
use std
const main = {args : byte[:][:]
chartypes()
}
const chartypes = {
var s
var c
var foo
var buf : byte[32]
s = "1世界äa\n"
while s.len != 0
(c, s) = std.striter(s)
foo = c
if !std.encode(buf[:std.charlen(c)], c)
std.write(1, "couldn't encode\n")
;;
std.write(1, buf[:std.charlen(c)])
;;
}