开发者

google app engine: how to set the python development's encoding environment same as the real one's?

I use python to develop my gae application in ubuntu. In my PC the app works well, but when uploaded to the appspot serve, my program will report encoding errors. like

UnicodeDecodeError: 'ascii' codec can't decode byte 0xe5 in position 3: ordinal not in range(128)

How to change my development environment to make the encoding 开发者_Python百科setting same?

Thanks.


Call sys.setdefaultencoding('ascii') somewhere in a module that is loaded for all requests.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜