看板 [ Perl ]
討論串[心得] Windows下unicode的txt檔案操作
共 3 篇文章
首頁
上一頁
1
下一頁
尾頁

推噓0(0推 0噓 2→)留言2則,0人參與, 最新作者garibaldi76 (賈寶迪)時間17年前 (2008/08/31 05:01), 編輯資訊
0
0
0
內容預覽:
剛剛再試了一下unicode轉big5, 結果發現對\r和BOM的處理會有問題, 所以要額. 外將\r和BOM清掉.... open INPUT, '<:raw:encoding(UTF-16LE)', "unicode.txt" or die "input fail: $!";;open OUTP
(還有160個字)

推噓0(0推 0噓 0→)留言0則,0人參與, 最新作者garibaldi76 (賈寶迪)時間17年前 (2008/08/31 04:44), 編輯資訊
0
0
1
內容預覽:
之前我遇到這問題有找到一個解法, 好像是\n和unicode相衝所以要加raw參數. open INPUT, '<:raw:encoding(UTF-16LE)', "test.txt" or die "input fail: $!";;open OUTPUT, '>:raw:encoding(UT
(還有57個字)

推噓1(1推 0噓 0→)留言1則,0人參與, 最新作者redmist (....N )時間17年前 (2008/08/28 23:50), 編輯資訊
0
0
0
內容預覽:
在window下的.txt檔案的編碼格式有ANSI(應該是最常用)、UTF-8、Unicode(UTF-16LE)、和Unicode big endian,之前處理utf-8的文字都是使用Encode這個模組. use Encode;. $line = <$FH>;. $line = decode(
(還有733個字)
首頁
上一頁
1
下一頁
尾頁