script は UTF-8 で書く use utf8; を使用し,perl に script が UTF-8 で書かれているという事を教える use strict; use warnings; use utf8; ファイルオープン時に文字コードを指定する open my $in, '<:encoding(euc-jp)', $infile or die "$!"; open my $out, '>:encoding(utf8)', $outfile or die "$!"; 外部から取り込むテキストデータは適切にデコードする use Encode; my $response = $ua->get($url) my $data = decode('shiftjis', $response->content); 外部に出力するテキストデータは適切にエンコードする use Encode; pr