use warnings; use strict; use Devel::Peek; my @tests = ( "Hello", "Hell\xF6", "\N{U+20AC}", "\xE2\x82\xAC", ); for my $in (@tests) { my $out = pack('U0C*', unpack('U0C*', $in)); print STDERR "##### ##### ##### pack/unpack ##### ##### #####\n"; Dump($in); Dump($out); print STDERR "##### upgrade #####\n"; Dump($in); utf8::upgrade($in); Dump($in); }