Opened 11 years ago
Closed 11 years ago
#21458 closed Bug (fixed)
Encoding error on /jsi18n/?language=ü
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | Internationalization | Version: | dev |
Severity: | Normal | Keywords: | UnicodeEncodeError, i18n, jsi18n |
Cc: | Baptiste Mispelon | Triage Stage: | Ready for checkin |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
When I pass utf-8 symbols in url /jsi18n/?language=ü, I get error:
UnicodeEncodeError at /jsi18n/ 'ascii' codec can't encode character u'\xfc' in position 0: ordinal not in range(128)
There is the similar error (django 1.6, django/utils/translation/trans_real.py, line 357), when I try to pass encoded symbols: /jsi18n/?language=%00%27:
TypeError at /jsi18n/ must be encoded string without NULL bytes, not unicode
It's better to catch this exception and do not throw HTTP 500 error.
Change History (4)
comment:1 by , 11 years ago
Cc: | added |
---|---|
Triage Stage: | Unreviewed → Accepted |
Version: | 1.6 → master |
comment:2 by , 11 years ago
Has patch: | set |
---|
PR here: https://github.com/django/django/pull/1947
Feedback welcome.
comment:4 by , 11 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
Hi,
I can reproduce both errors (the first one only under Python 2).
From the looks of it, there's a similar bug in the
set_language
view as well.