use utf8; or, on the command line, perl -Mutf8 -e '$c="f6"; $u=pack("U",hex($c)); print $u, "\x{f6}"' | od -tx1