facebook-python sdk 可以在发布日语消息时处理。我可以毫无问题地发布英文信息,但是当我尝试发布日文时
graph.put_object("me", "feed", message=u'あなたが大好きだよ')
我在下面收到错误。我该怎么办?
Traceback (most recent call last):
File "/base/data/home/apps/s~posttofacebook123456/1.365133296513228525/kay/app.py", line 371, in get_response
response = view_func(request, **values)
File "/base/data/home/apps/s~posttofacebook123456/1.365133296513228525/myapp/views.py", line 116, in index
graph.put_object("me", "feed", message=u'あなたが大好きだよ')
File "/base/data/home/apps/s~posttofacebook123456/1.365133296513228525/myapp/facebook.py", line 140, in put_object
post_args=data)
File "/base/data/home/apps/s~posttofacebook123456/1.365133296513228525/myapp/facebook.py", line 291, in request
post_data = None if post_args is None else urllib.urlencode(post_args)
File "/python27_runtime/python27_dist/lib/python2.7/urllib.py", line 1289, in urlencode
v = quote_plus(str(v))
UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-8: ordinal not in range(128)