Re: python-gammu - how do I encode/decode an SMS which contains emoji?
[email protected] Fri, 10 Feb 2017 13:58:40 +0000
| Newsgroups | gmane.linux.drivers.gammu |
|---|---|
| Message-ID | <[email protected]> |
Thanks Michal - at least I know now that I'm not doing something silly. If I were a more experienced programmer, I'd have a stab at fixing the Python bindings myself - but sadly, C/C++ programming at this level is a little beyond my reach! On 10/02/2017 13:44, Michal Čihař wrote: Hi [email protected] píše v Čt 09. 02. 2017 v 00:08 +0000: Hi, I'm unable to successfully encode/decode an SMS containing emoji. Using Python 3 and the Python-Gammu library, I encode a PDU for message text containing an emoji character 😂 (Unicode character U+1F602 - "FACE WITH TEARS OF JOY"): The PDU returned is "07918188558588f811000b912121551532f40018ff02f602". When I then decode this PDU using the Python-Gammu library, the message text contains an unrecognised character (\xEF\x98\x82), rather than the Unicode emoji character. *** I get the same result using Wammu's own encoder and decoder tools at https://wammu.eu/tools/pdu-encode/ and https://wammu.eu/tools/pdu-decode/ . *** I wonder whether this is something to do with the gammu library working strictly to the GSM specification and interpreting the UDH payload as UCS-2 encoded rather than as UTF-16. Nevertheless, emoji are now in common use within SMS messages, and I need to find a way of converting gammu's literal decoding back to the original emoji as entered by the sending party. Would anyone please be able to guide me on how to achieve this? This can be achieved by fixing bug in python-gammu :-). See our issue tracker: https://github.com/gammu/python-gammu/issues/16 ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, SlashDot.org! http://sdm.link/slashdot _______________________________________________ Gammu-users mailing list - https://lists.sourceforge.net/lists/listinfo/gammu-users ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, SlashDot.org! http://sdm.link/slashdot _______________________________________________ Gammu-users mailing list - https://lists.sourceforge.net/lists/listinfo/gammu-users