$s2u = Text::Iconv->new("sjis", "utf-8"); $x = $s2u->convert($str); $x = decode("utf-8",$x); #Causes Perl to correctly treat the string as unicode because utf-8 flag is on [oi].