fix #11, EUC-TW encoding exception
This commit is contained in:
parent
ca8e3f84a9
commit
ba395385a0
7
CHANGES
7
CHANGES
|
|
@ -1,6 +1,13 @@
|
|||
CHANGES
|
||||
-------
|
||||
|
||||
# 0.6.42
|
||||
|
||||
- added parsing for WX (positionless and in comment)
|
||||
- fix exception due to EUC-TW encoding, #11
|
||||
|
||||
# LOTS OF MINOR STUFF
|
||||
|
||||
# v0.6.37
|
||||
|
||||
- charset detection, unicode for all
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ def _unicode_packet(packet):
|
|||
|
||||
# attempt to detect encoding
|
||||
res = chardet.detect(packet.split(b':', 1)[-1])
|
||||
if res['confidence'] > 0.7:
|
||||
if res['confidence'] > 0.7 and res['encoding'] != 'EUC-TW':
|
||||
try:
|
||||
return packet.decode(res['encoding'])
|
||||
except UnicodeDecodeError:
|
||||
|
|
|
|||
Loading…
Reference in New Issue