2015-05-10 20:39 GMT+02:00 Albert-Jan Roskam <fo...@yahoo.com>:
> > Hi, > > I only have Python 2 on my phone, but I am suprised that you (and are able > to) decode unicode strings. What result do you get when you do the > following in Python 3: > > Python 2.7.2 (default, Oct 25 2014, 20:52:15) > [GCC 4.9 20140827 (prerelease)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> import codecs > >>> codecs.decode(b'€', 'unicode-escape') > u'\xe2\x82\xac' > >>> codecs.encode(u'€', 'unicode-escape') > '\\xe2\\x82\\xac' > >>> > > Python 3.3.3 (default, Nov 27 2013, 17:12:35) [GCC 4.8.2] on linux >>> import codecs >>> codecs.decode(b'€', 'unicode-escape') File "<stdin>", line 1 SyntaxError: bytes can only contain ASCII literal characters. >>> codecs.encode(u'€', 'unicode-escape') b'\\u20ac'
-- https://mail.python.org/mailman/listinfo/python-list