utf8' codec can't decode byte 0xc0 in position 227:invalid start byte,代码如下:#encoding=utf8 from blog.models import Article,Tag,Classificationfrom django.shortcuts import render_to_responsefrom django.template import RequestContextdef blog_li

来源:学生作业帮助网 编辑:作业帮 时间:2024/11/27 01:43:44
utf8' codec can't decode byte 0xc0 in position 227:invalid start byte,代码如下:#encoding=utf8 from blog.models import Article,Tag,Classificationfrom django.shortcuts import render_to_responsefrom django.template import RequestContextdef blog_li
xU[OG+#EzM 5H@@Ț]ffLTh6U*QDOHP.ƀy_"xd̹|wΙr22+d "1O"aɷ<$Rså xuц)c˧G}wͫ 04=YQIXi3ǚf"1tZ/?3 Xc#jL% Z]QU5@'Rh@3r{߁{-fF mSˤrFIM5T7Twj|IN\\Aq(-Y[ K*U,3Y*U v2^.iި/$+0-%`8ni4cƳ(^޾#ǭZD09ì9{v(xY͊RRfȈyuψ̃iȚ+2`\3,d Ƽn@ǝwAb: S1Ve?' T*p4s0 RiN- cN6  THĀ63 gUJAtOn'j]<ÝGv7zlGkqyX:z{ޜ9IKэO?[ħ/XbZzfYrƏrNx)G;׻i[?9c®NJ;;b

utf8' codec can't decode byte 0xc0 in position 227:invalid start byte,代码如下:#encoding=utf8 from blog.models import Article,Tag,Classificationfrom django.shortcuts import render_to_responsefrom django.template import RequestContextdef blog_li
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
指向了最后一行

utf8' codec can't decode byte 0xc0 in position 227:invalid start byte,代码如下:#encoding=utf8 from blog.models import Article,Tag,Classificationfrom django.shortcuts import render_to_responsefrom django.template import RequestContextdef blog_li
不行就转一下码试试.%D%A%D%A user['UserName'].encode('gbk') 或者是utf8,utf16,看你user里面的编码了.