作者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