1π
I donβt have much experience with Django, but I have dealt with that exception a lot when working with Chinese text in Python. Usually you need to use decode() with a Chinese codec. I have found that βgb18030β works most frequently. So e.g., if you have a variable foo
that holds Chinese strings, try foo.decode('gb18030')
π€elethan
0π
I know this is a bit old, but I was able to solve a similar error, using in top of forms.py the lines:
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
A similar error was reported here:
UnicodeEncodeError: 'ascii' codec can't encode character u'\xa0' in position 20: ordinal not in range(128)
π€mseromenho
- [Answer]-Django admin: Adding a textarea and a button that invokes a function
- [Answer]-How to filter users using UserProfile field in Django 1.7?
- [Answer]-Django REST framework β What is the correct way of registering / validating new users?
- [Answer]-Connect MySQL Workbench with Django in Eclipse in a mac
- [Answer]-Django β customizing the add view of the admin page
Source:stackexchange.com