2011-11-05から1日間の記事一覧

Encode.pmでエンコードできなかった文字の扱い

例えばこういうの*1。 use strict; use warnings; use Encode; my $utf8str = "あいらとふれあ、コラボっちゃお(ハート)"; Encode::_utf8_off($utf8str); my $sjisstr = encode('cp932', decode('utf8', $utf8str)); print $sjisstr; $ perl a.pl あいらとふ…