veezzz
V2EX  ›  Django

python3 django1.8 多语言编码问题

  •  
  •   veezzz · Aug 17, 2015 · 3591 views
    This topic created in 3949 days ago, the information mentioned may be changed or developed.

    使用 django1.8 开发一个项目在处理完多语言后遇到这种问题

    UnicodeDecodeError at /
    'ascii' codec can't decode byte 0xe1 in position 13: ordinal not in     range (128 )
    Request Method: GET
    Request URL:    http://127.0.0.1:8000/
    Django Version: 1.8.3
    Exception Type: UnicodeDecodeError
    Exception Value:    
    'ascii' codec can't decode byte 0xe1 in position 13: ordinal not in     range (128 )
    Exception Location:         /usr/local/Cellar/python3/3.4.3/Frameworks/Python.framework/Versions/3.4/lib/python3.4/gettext.py in _parse, line 300
    Python Executable:      /Users/veerkat/Documents/workspace/tapplex_accounts_for_python3_django1.8/env/bin/python
    Python Version: 3.4.3
    

    python3 默认是支持 utf8 的吧,为什么会出现这种问题

    2 replies    2015-08-18 10:01:58 +08:00
    iwillhappy1314
        1
    iwillhappy1314  
       Aug 18, 2015
    文件保存的时候没有保存成 utf-8 编码的吧。
    veezzz
        2
    veezzz  
    OP
       Aug 18, 2015
    @iwillhappy1314 我也怀疑是, 多谢解答
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3200 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 13:49 · PVG 21:49 · LAX 06:49 · JFK 09:49
    ♥ Do have faith in what you're doing.