#4886 closed (invalid)
Unicode Error
Reported by: | BBB | Owned by: | Adrian Holovaty |
---|---|---|---|
Component: | Core (Other) | Version: | dev |
Severity: | Keywords: | unicode, fixtures, utf-8 | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Hello,
I have save my fixtures files in UTF-8. And when I try to see the data in admin interface, I have this error message :
UnicodeEncodeError at /admin/annonces/annonce/add/
'ascii' codec can't encode character u'\xe9' in position 4: ordinal not in range(128)
Request Method: GET
Request URL: http://127.0.0.1:8000/admin/annonces/annonce/add/
Exception Type: UnicodeEncodeError
Exception Value: 'ascii' codec can't encode character u'\xe9' in position 4: ordinal not in range(128)
Exception Location: C:\django_unicode\django\utils\encoding.py in force_unicode, line 40
Python Executable: C:\Python25\python.exe
Python Version: 2.5.0
Traceback (most recent call last):
File "C:\django_unicode\django\core\handlers\base.py" in get_response
- response = callback(request, *callback_args, callback_kwargs)
File "C:\django_unicode\django\contrib\admin\views\decorators.py" in _checklogin
- return view_func(request, *args, kwargs)
File "C:\django_unicode\django\views\decorators\cache.py" in _wrapped_view_func
- response = view_func(request, *args, kwargs)
File "C:\django_unicode\django\contrib\admin\views\main.py" in add_stage
- manipulator = model.AddManipulator()
File "C:\django_unicode\django\db\models\manipulators.py" in init
- self.fields.extend(f.get_manipulator_fields(self.opts, self, self.change))
File "C:\django_unicode\django\db\models\fields\init.py" in get_manipulator_fields
- field_objs, params = self.prepare_field_objs_and_params(manipulator, name_prefix)
File "C:\django_unicode\django\db\models\fields\related.py" in prepare_field_objs_and_params
- paramschoices = self.get_choices_default()
File "C:\django_unicode\django\db\models\fields\init.py" in get_choices_default
- return self.get_choices()
File "C:\django_unicode\django\db\models\fields\init.py" in get_choices
- lst = [(getattr(x, self.rel.get_related_field().attname), smart_unicode(x)) for x in rel_model._default_manager.complex_filter(self.rel.limit_choices_to)]
File "C:\django_unicode\django\utils\encoding.py" in smart_unicode
- return force_unicode(s, encoding, strings_only, errors)
File "C:\django_unicode\django\utils\encoding.py" in force_unicode
- s = unicode(str(s), encoding, errors)
UnicodeEncodeError at /admin/annonces/annonce/add/
'ascii' codec can't encode character u'\xe9' in position 4: ordinal not in range(128)
I use SVN trunk version and I have the same error with Unicode branche.
Change History (2)
comment:1 by , 17 years ago
Cc: | removed |
---|---|
Resolution: | → invalid |
Status: | new → closed |
The Unicode branch has already been merged into Trunk. Please follow carefully the porting steps that are explained here:
http://code.djangoproject.com/wiki/UnicodeBranch#PortingApplicationsTheQuickChecklist
You are probably seeing that error because you haven't changed your models'
__str__
methods to__unicode__
.If you still have problems, please bring your question to the Django-Users mailing list:
http://groups.google.com/group/django-users/