开发者

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

开发者 https://www.devze.com 2023-01-19 23:25 出处:网络
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

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

精彩评论

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