#4773 closed (worksforme)
UnicodeEncodeError on dropdowns in admin
Reported by: | Owned by: | Adrian Holovaty | |
---|---|---|---|
Component: | contrib.admin | Version: | dev |
Severity: | Keywords: | ||
Cc: | Triage Stage: | Unreviewed | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Running rev 5260. A non-ascii character (British pound sign), being drawn into a drop down seems to have caused a UnicodeEncodeError in force_unicode. I'm not familiar with the recent unicode merge but the patch here has solved my immediate problem.
Attachments (1)
Change History (4)
by , 17 years ago
Attachment: | unicode_fix.diff added |
---|
comment:1 by , 17 years ago
comment:2 by , 17 years ago
Component: | Core framework → Admin interface |
---|---|
Resolution: | → worksforme |
Status: | new → closed |
Hi Sime, recently, Malcolm merged in a big patch that should solve all the usual unicode problems. Please take a look at the documentation cited in the posting above in this ticket. Can you please try again with an up to date version and reopen if the problem persists? Thanks!
comment:3 by , 17 years ago
Since you talk about force_unicode, I'm guessing you mean you are running 5620, not 5260.
This patch doesn't look like the right fix; it's exploiting a slightly ugly feature of smart_str that should only be required for broken code, from memory.
Can you please provide an example of how to repeat the problem so that we can try to work out the right fix. At a minimum, what is str(s) returning when the error occurs (it should be UTF-8, so I'm confused as to why any encoding error would be occurring). And is the 'encoding' parameter anything other than 'utf-8' when the problem occurs?
A traceback would be useful, too.
Did you take notice of http://www.djangoproject.com/documentation/unicode/?