Closed GoogleCodeExporter closed 8 years ago
Using google-api-python-client-1.0beta7.tar.gz
Original comment by michael....@chinamonitorinc.com
on 2 Jan 2012 at 5:27
Chinese characters must be supplied in unicode strings:
$ python
Python 2.6.5 (r265:79063, Apr 16 2010, 13:57:41)
[GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> q=['由“基督']
>>> q[0].encode('utf-8')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe7 in position 0: ordinal
not in range(128)
>>> q=[u'由“基督']
>>> q[0].encode('utf-8')
'\xe7\x94\xb1\xe2\x80\x9c\xe5\x9f\xba\xe7\x9d\xa3'
>>>
Original comment by jcgregorio@google.com
on 2 Jan 2012 at 5:29
Thank you so much!!! Just add the 'u' and it works like a charm! Thanks again!!
Original comment by michael....@chinamonitorinc.com
on 2 Jan 2012 at 5:39
Original issue reported on code.google.com by
michael....@chinamonitorinc.com
on 2 Jan 2012 at 3:58