Python UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 ordinal not in range(128)

前端 未结 3 521
轻奢々
轻奢々 2020-12-31 10:07

I\'m trying to write my first app in Google App Engine with Python (link of the app: http://contractpy.appspot.com/ - it\'s just an experimental app). The entire code is bel

3条回答
  •  既然无缘
    2020-12-31 10:30

    You should really use a proper templating system. Jinja2 is included with AppEngine.

    However in the meantime your problem is that your templates are ASCII but your data is not (can't tell if it's utf-8 or unicode). Easy solution is to prefix each template string with u to make it Unicode.

    But, you should really use a proper templating system.

提交回复
热议问题