From ba395385a0be775aeadf39f24b6034a129d2b950 Mon Sep 17 00:00:00 2001 From: Rossen Georgiev Date: Tue, 19 Jan 2016 07:18:14 +0000 Subject: [PATCH] fix #11, EUC-TW encoding exception --- CHANGES | 7 +++++++ aprslib/parsing.py | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index fcc36c6..1373141 100644 --- a/CHANGES +++ b/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 diff --git a/aprslib/parsing.py b/aprslib/parsing.py index d63d93a..c4cd279 100644 --- a/aprslib/parsing.py +++ b/aprslib/parsing.py @@ -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: