Mar 25, 2009

perl 中文 string split by use encoding big5

Perl 處理中文, 加入

use encoding big5;
$string="中文成功123";
後, split(//,$string); 即可拆成 "中","文","成","功","1","2","3"

若是從資料庫取得的字串, 可試試
$string=decode("big5", $string);
再做 @str=split(//,$string);

0 意見: