RosettaCodeData/Task/UTF-8-encode-and-decode/BaCon/utf-8-encode-and-decode.bacon

11 lines
268 B
Plaintext

DECLARE x TYPE STRING
CONST letter$ = "A ö Ж € 𝄞"
PRINT "Char", TAB$(1), "Unicode", TAB$(2), "UTF-8 (hex)"
PRINT "-----------------------------------"
FOR x IN letter$
PRINT x, TAB$(1), "U+", HEX$(UCS(x)), TAB$(2), COIL$(LEN(x), HEX$(x[_-1] & 255))
NEXT