看板 Perl 關於我們 聯絡資訊
試試 use utf8; open (SRC, "test.txt"); binmode (SRC, ":encoding(big5)") binmode (SRC, ":encoding(big5)") 這樣子你就不需要encode和decode ※ 引述《irenec (nickname)》之銘言: : ※ 引述《littleshan (我要加入劍道社!)》之銘言: : : 轉成utf8...是個方法 : 我做了這樣的測試: : use Encode; : use Text::ParseWords; : open (SRC,"test.txt"); : while(<SRC>){ : chomp; : $data = encode("utf8", $_); : @words = &parse_line('\,', 0, $data); : foreach(@words){ : $output = decode("utf8", $_); : print "$_\n"; $_的內容似乎是utf8 encoding : } : } : close(SRC); : 結果還是亂碼... 是不是哪裡錯了 ?! : : 不曉得你想要做怎樣的處理? : 把CSV解成ARRAY後, 做一些格式判斷(RE), 然後塞入資料庫 : 目前的狀況是做到CSV解開就卡住了.. >"< -- -- ※ 發信站: 批踢踢實業坊(ptt.csie.ntu.edu.tw) ◆ From: 140.112.244.211