From: pycage Date: Wed, 6 Jan 2010 20:59:16 +0000 (+0000) Subject: fixed decoding bug X-Git-Url: http://vcs.maemo.org/git/?p=ussd-widget;a=commitdiff_plain;h=147d2941a3eb9f4e7c84516da55df7b6021b7d30 fixed decoding bug git-svn-id: file:///svnroot/ussd-widget/trunk@7 d197f4d6-dc93-42ad-8354-0da1f58e353f --- diff --git a/ussd-common/src/usr/lib/python2.5/gsmdecode.py b/ussd-common/src/usr/lib/python2.5/gsmdecode.py index f1b727c..924c24a 100644 --- a/ussd-common/src/usr/lib/python2.5/gsmdecode.py +++ b/ussd-common/src/usr/lib/python2.5/gsmdecode.py @@ -165,7 +165,7 @@ def decode(s, n): # separate into nibbles hbits = (n & 0xf0) >> 4 lbits = (n & 0x0f) - + if (hbits == 0x0): # language return _decode_language(s, lbits) @@ -217,20 +217,21 @@ def _decode_general_data_coding(s, h, l): is_compressed = (h & 0x2) alphabet = (l & 0xc) >> 2 - if (l == 0x0): + + if (alphabet == 0x0): # default alphabet return _decode_defaul_alphabet(s) - elif (l == 0x1): + elif (alphabet == 0x1): # 8 bit # actually, encoding is user-defined, but let's assume hex'd ASCII # for now return _decode_hex(s) - elif (l == 0x2): + elif (alphabet == 0x2): # USC2 (16 bit, BE) return _decode_usc2(s) - elif (l == 0x3): + elif (alphabet == 0x3): # reserved return s