看板 Python 關於我們 聯絡資訊
讀取 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
godfat:試試 big5-hkscs 09/13 15:23
huggie:多謝, it works 09/13 15:35
huggie:另外想問, 每次讀近來都得用 ''.decode() 有沒有辦法設定 09/13 15:35
huggie:一次,或建立什麼wrapper 09/13 15:36
yungyuc:你可以 subclass file object 作 wrapping 09/14 01:31
huggie:物件在哪? os.file? 09/17 11:56
huggie:好呆...好像沒這個東西.. 09/17 11:58