作者huggie (huggie)
看板Python
標題[問題] big5
時間Sat Sep 13 15:10:00 2008
讀取 html時,發現 "碁" 這個字不是 big5 encoding
查了一下是似乎倚天的 extension? 這時怎麼處理?
decode 時會這樣說:
UnicodeDecodeError: 'big5' codec can't decode bytes in position 75-76:
illegal multibyte sequence
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 59.104.221.85
1F:推 godfat:試試 big5-hkscs 09/13 15:23
2F:→ huggie:多謝, it works 09/13 15:35
3F:→ huggie:另外想問, 每次讀近來都得用 ''.decode() 有沒有辦法設定 09/13 15:35
4F:→ huggie:一次,或建立什麼wrapper 09/13 15:36
5F:→ yungyuc:你可以 subclass file object 作 wrapping 09/14 01:31
6F:→ huggie:物件在哪? os.file? 09/17 11:56
7F:→ huggie:好呆...好像沒這個東西.. 09/17 11:58