开发者

Im getting "The server encountered an error and could not complete your request" error

Im getting "The server encountered an error and could not complete your request" error in my google app engine:

my app.yaml:

application: myapp
version: 2
runtime: python
api_version: 1

builtins:
- remote_api: on
- datastore_admin: on

handlers:
- url: /AJAX
  script: main.py

- url: /emailtrigger
  script: main.py

- url: /emailworker
  script: main.py

- url: /
  static_files: static_files/index.html
  upload: static_files

- url: /
  static_dir: static_files
开发者_Go百科

error in log:

<type 'exceptions.SyntaxError'>: Non-ASCII character '\xc3' in file /base/data/home/apps/myapp/2.349019521625775975/main.py on line 77, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details (main.py, line 77)

I have a string with a character: ã; the main.py is utf-8 encoded


  1. try adding this as first line of your code

# -- coding: utf-8 --

  1. try coverting your strings to unicode

    self.response.out.write(unicode("ã","UTF-8"))

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜