Djang中的UnicodeEncodeError

2024-10-02 20:42:08 发布

您现在位置:Python中文网/ 问答频道 /正文

我试图在我的应用程序中加载一个页面,然后弹出下面的错误。我用tweepy连接twitter。我不知道错误是从哪里来的,也不知道我需要修复的线路。我很想知道如何解决这个问题。在

  UnicodeEncodeError at /test/

   'charmap' codec can't encode character u'\u2019' in position 6: character maps to   <undefined>

   Request Method:      GET
   Request URL:     http://127.0.0.1:8000/test/
   Django Version:  1.3.1
   Exception Type:  UnicodeEncodeError
   Exception Value: 'charmap' codec can't encode character u'\u2019' in position 6: character maps to <undefined>
  Exception Location:   C:\Python27\lib\encodings\cp437.py in encode, line 12
  Python Executable:    C:\Python27\python.exe
  Python Version:   2.7.2

在视图.py在

^{pr2}$

Tags: tointest错误exceptionpositioncancodec