perl -wE' use Encode; use Devel::Peek; my $bytes = "ä ö ü"; my $chars = decode_utf8("ä ö ü"); my $latin1 = encode(latin1 => $chars); Dump $bytes; Dump $chars; Dump $latin1; ' # $bytes SV = PV(0x850b78) at 0x86fc20 REFCNT = 1 FLAGS = (PADMY,POK,pPOK) PV = 0x86a4e0 "\303\244 \303\266 \303\274"\0 CUR = 8 LEN = 16 # $chars SV = PV(0x851228) at 0x86fc68 REFCNT = 1 FLAGS = (PADMY,POK,pPOK,UTF8) PV = 0x8a9d00 "\303\244 \303\266 \303\274"\0 [UTF8 "\x{e4} \x{f6} \x{fc}"] CUR = 8 LEN = 16 # $latin1 SV = PV(0x8514e8) at 0x86fc08 REFCNT = 1 FLAGS = (PADMY,POK,pPOK) PV = 0x94e9b0 "\344 \366 \374"\0 CUR = 5 LEN = 8