Pycharm编码问题导致django UnicodeDecodeError 报错
2016-02-02 13:29
429 查看
pycharm 默认的配置,会导致创建的文件按照GBK的方式保存文件。
从而触发UnicodeDecodeError: 'utf8' codec can't decode byte 0xba in position 92: invalid start byte 报错
检查 view.py | settings.py | html 文件都配置了utf8 ,所以是编辑器的问题。
修改:file - settings - file encodings - IDE Encoding | Project Encoding UTF-8
default encoding for properties files :utf-8
修改:file - default settings - file encodings - IDE Encoding | Project Encoding UTF-8
default encoding for properties files :utf-8
从而触发UnicodeDecodeError: 'utf8' codec can't decode byte 0xba in position 92: invalid start byte 报错
检查 view.py | settings.py | html 文件都配置了utf8 ,所以是编辑器的问题。
修改:file - settings - file encodings - IDE Encoding | Project Encoding UTF-8
default encoding for properties files :utf-8
修改:file - default settings - file encodings - IDE Encoding | Project Encoding UTF-8
default encoding for properties files :utf-8
相关文章推荐
- 将编码从GB2312转成UTF-8的方法汇总(从前台、程序、数据库)
- UTF-8、Unicode 标准化表单、BOM
- ASP UTF-8页面乱码+GB2312转UTF-8 +生成UTF-8格式的文件(编码)第1/2页
- ASP+FSO生成的网页文件默认编码格式以及转换成UTF-8编码方法
- php中json_encode UTF-8中文乱码的更好解决方法
- php utf-8转unicode的函数第1/2页
- django中使用jquery ajax post数据出现403错误的解决办法(两种方法)
- django使用ajax post数据出现403错误如何解决
- utf-8编码引起js输出中文乱码的解决办法
- Shell脚本把文件从GBK转为UTF-8编码
- jq的get传参数在utf-8中乱码问题的解决php版
- php UTF-8、Unicode和BOM问题
- php中文乱码怎么办如何让浏览器自动识别utf-8
- 将字符串转换成gb2312或者utf-8编码的参数(js版)
- Ajax,UTF-8还是GB2312 eval 还是execScript
- UTF-8 GBK UTF8 GB2312 之间的区别和关系介绍
- utf-8 网页不显示+utf-8网页乱码的通用解决方法
- windows+apache+mod_python配置django运行环境
- python Django连接MySQL数据库做增删改查
- django自定义Field实现一个字段存储以逗号分隔的字符串