utf8' codec can't decode byte 0xc0 in position 227:invalid s
来源:学生作业帮 编辑:神马作文网作业帮 分类:综合作业 时间:2024/11/17 21:03:31
utf8' codec can't decode byte 0xc0 in position 227:invalid start byte,
代码如下:
#encoding=utf8
from blog.models import Article,Tag,Classification
from django.shortcuts import render_to_response
from django.template import RequestContext
def blog_list(request):
blogs = Article.objects.all().order_by('-publish_time')
return render_to_response('index.html',{'blogs':blogs},context_instance=RequestContext(request))
错误是
UnicodeDecodeError at /
'utf8' codec can't decode byte 0xc0 in position 227:invalid start byte
Request Method:
GET
Request URL:
Django Version:
1.7
Exception Type:
UnicodeDecodeError
Exception Value:
'utf8' codec can't decode byte 0xc0 in position 227:invalid start byte
Exception Location:
D:\Python\lib\encodings\utf_8.py in decode,line 16
Python Executable:
D:\Python\python.exe
Python Version:
2.7.8
Python Path:
['E:\\Django\\dblog',
'D:\\Python\\lib\\site-packages\\setuptools-6.0.3dev-py2.7.egg',
'D:\\Python\\lib\\site-packages\\django-1.7-py2.7.egg',
'C:\\Windows\\system32\\python27.zip',
'D:\\Python\\DLLs',
'D:\\Python\\lib',
'D:\\Python\\lib\\plat-win',
'D:\\Python\\lib\\lib-tk',
'D:\\Python',
'D:\\Python\\lib\\site-packages',
'D:\\Python\\lib\\site-packages\\win32',
'D:\\Python\\lib\\site-packages\\win32\\lib',
'D:\\Python\\lib\\site-packages\\Pythonwin']
Server time:
Mon,6 Oct 2014 12:05:00 +0800
指向了最后一行
代码如下:
#encoding=utf8
from blog.models import Article,Tag,Classification
from django.shortcuts import render_to_response
from django.template import RequestContext
def blog_list(request):
blogs = Article.objects.all().order_by('-publish_time')
return render_to_response('index.html',{'blogs':blogs},context_instance=RequestContext(request))
错误是
UnicodeDecodeError at /
'utf8' codec can't decode byte 0xc0 in position 227:invalid start byte
Request Method:
GET
Request URL:
Django Version:
1.7
Exception Type:
UnicodeDecodeError
Exception Value:
'utf8' codec can't decode byte 0xc0 in position 227:invalid start byte
Exception Location:
D:\Python\lib\encodings\utf_8.py in decode,line 16
Python Executable:
D:\Python\python.exe
Python Version:
2.7.8
Python Path:
['E:\\Django\\dblog',
'D:\\Python\\lib\\site-packages\\setuptools-6.0.3dev-py2.7.egg',
'D:\\Python\\lib\\site-packages\\django-1.7-py2.7.egg',
'C:\\Windows\\system32\\python27.zip',
'D:\\Python\\DLLs',
'D:\\Python\\lib',
'D:\\Python\\lib\\plat-win',
'D:\\Python\\lib\\lib-tk',
'D:\\Python',
'D:\\Python\\lib\\site-packages',
'D:\\Python\\lib\\site-packages\\win32',
'D:\\Python\\lib\\site-packages\\win32\\lib',
'D:\\Python\\lib\\site-packages\\Pythonwin']
Server time:
Mon,6 Oct 2014 12:05:00 +0800
指向了最后一行
不行就转一下码试试.%D%A%D%A user['UserName'].encode('gbk') 或者是utf8,utf16,看你user里面的编码了.
Python 报错'ascii' codec can't decode byte 0xe5 in position 0:
It isn't as if he's in any position to pass judgement!
SYNR =0xc0 | 0x07 ;REFDV=0x80 | 0x01 中0xc0 | 0x07和0x80 |
invalid character in
I hope in your heart can have a position!
byte
Is women's position too high in China?
Position(s) Applied For (in order of preference):
You can't control everything in a trait's world
we can't see the s--------- in the day.
The boss can only give a position,can't give a future.Stage
Invalid