看板 [ Perl ]
討論串[問題] 特殊的中文字
共 6 篇文章
首頁
上一頁
1
2
下一頁
尾頁

推噓0(0推 0噓 0→)留言0則,0人參與, 最新作者irenec (nickname)時間22年前 (2003/09/09 10:10), 編輯資訊
0
0
1
內容預覽:
找到一個function :. quotemeta $string. 作用是 non-alphanumeric characters backslashed. 不過如此一來 Text::ParseWords 運作起來會不正常. 只好再用RE把變成「\"」和「\,」的double-quote和comm

推噓0(0推 0噓 0→)留言0則,0人參與, 最新作者irenec (nickname)時間22年前 (2003/09/09 06:42), 編輯資訊
0
0
1
內容預覽:
謝謝... 我把code改成:. use Text::ParseWords;. use utf16;. open (SRC,"test.txt"); #text.txt的內容是 "許正雄","名字許正雄". binmode (SRC ":encoding(big5)");. while(<SRC>)
(還有221個字)

推噓0(0推 0噓 0→)留言0則,0人參與, 最新作者littleshan (我要加入劍道社!)時間22年前 (2003/09/09 04:13), 編輯資訊
0
0
0
內容預覽:
試試. use utf8;. open (SRC, "test.txt");. binmode (SRC, ":encoding(big5)"). binmode (SRC, ":encoding(big5)"). 這樣子你就不需要encode和decode. $_的內容似乎是utf8 encodi

推噓0(0推 0噓 0→)留言0則,0人參與, 最新作者irenec (nickname)時間22年前 (2003/09/09 02:42), 編輯資訊
0
0
1
內容預覽:
我做了這樣的測試:. use Encode;. use Text::ParseWords;. open (SRC,"test.txt");. while(<SRC>){. chomp;. $data = encode("utf8", $_);. @words = &parse_line('\,',
(還有135個字)

推噓0(0推 0噓 0→)留言0則,0人參與, 最新作者littleshan (我要加入劍道社!)時間22年前 (2003/09/08 15:27), 編輯資訊
0
0
0
內容預覽:
轉成utf8...是個方法. 不曉得你想要做怎樣的處理?. --. --. 發信站: 批踢踢實業坊(ptt.csie.ntu.edu.tw). ◆ From: 140.112.244.211.
首頁
上一頁
1
2
下一頁
尾頁