sub utf16bom { my $s = shift; $s = encode("utf8", "$s") if (utf8::is_utf8($s)); Encode::from_to($s, 'utf-8', 'UTF-16LE'); if($@) { die 'encoding error'; } $s= "\xff\xfe" . $s . "\x0\x0"; return $s; }
0 件のコメント:
コメントを投稿