bright
bright

Reputation: 137

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 setting same?

Thanks.

Upvotes: 1

Views: 288

Answers (1)

Nick Johnson
Nick Johnson

Reputation: 101139

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

Upvotes: 1

Related Questions