$ perl -wE' use utf8; use CGI; use Devel::Peek; use Encode; my $cgi = CGI->new; my $test = decode_utf8 $cgi->param("test"); # <--- decode Dump $test; my $x = substr($test, 0, 1); Dump $x;' "test=%C3%A4" SV = PV(0x8872868) at 0x8777a80 REFCNT = 1 FLAGS = (PADMY,POK,pPOK,UTF8) PV = 0x8834e80 "\303\244"\0 [UTF8 "\x{e4}"] CUR = 2 LEN = 4 SV = PV(0x8872858) at 0x8841818 REFCNT = 1 FLAGS = (POK,pPOK,UTF8) PV = 0x8834e90 "\303\244"\0 [UTF8 "\x{e4}"] CUR = 2 LEN = 4