use Encode; my $str = decode('euc-jp',"あいうえお"); my $from = decode('euc-jp',"あいうえお"); my $to = decode('euc-jp',"12345"); # eval "\$str =~ tr/\$from/\$to/"; じゃ駄目だよ eval "\$str =~ tr/$from/$to/"; print encode('euc-jp',$str)."\n";