V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
veezzz
V2EX  ›  Django

python3 django1.8 多语言编码问题

  •  
  •   veezzz · 2015-08-17 10:18:53 +08:00 · 2674 次点击
    这是一个创建于 3172 天前的主题,其中的信息可能已经有所发展或是发生改变。

    使用 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 条回复    2015-08-18 10:01:58 +08:00
    iwillhappy1314
        1
    iwillhappy1314  
       2015-08-18 08:36:35 +08:00
    文件保存的时候没有保存成 utf-8 编码的吧。
    veezzz
        2
    veezzz  
    OP
       2015-08-18 10:01:58 +08:00
    @iwillhappy1314 我也怀疑是, 多谢解答
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   4157 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 34ms · UTC 05:29 · PVG 13:29 · LAX 22:29 · JFK 01:29
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.