Archive for the ‘ Collect ’ Category

Big5/UTF-8 編碼轉換的模組

Big5 及 UTF-8 編碼的轉換方式有兩種 (請先安裝 Encode::compat 模組):

方式一

use Encode::compat;
use Encode qw(from_to);

my $string = "中文";

#Big5 轉 UTF-8
from_to($string, 'big5', 'utf8');
print "$string\n";

#UTF-8 轉 Big5
from_to($string, 'utf8', 'big5');
print "$string\n";

Read more

return top