Opened 15 years ago

Closed 15 years ago

#12448 closed (fixed)

UnicodeDecodeError at /admin/jsi18n/ ('ascii', 'j F Y \xd0\xb3.', 6, 7, 'ordinal not in range(128)')

Reported by: ramusus Owned by: Jannis Leidel
Component: Internationalization Version: 1.1
Severity: Keywords:
Cc: ramusus@… Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

After http://code.djangoproject.com/changeset/11964#file120 changeset, when I try to load http://localhost/admin/jsi18n/ page, I get this error:

UnicodeDecodeError at /admin/jsi18n/

('ascii', 'j F Y \xd0\xb3.', 6, 7, 'ordinal not in range(128)')

Error on line:

 211. src.append("catalog['%s'] = '%s';\n" % (javascript_quote(k), javascript_quote(unicode(v)))) ...

Local vars:

k = 'DATE_FORMAT'
v = 'j F Y \xd0\xb3.'

Attachments (1)

django_i18n.diff (660 bytes ) - added by ramusus 15 years ago.

Download all attachments as: .zip

Change History (6)

by ramusus, 15 years ago

Attachment: django_i18n.diff added

comment:1 by ramusus, 15 years ago

Additional info from settings.py:

TIME_ZONE = 'Europe/Moscow'
LANGUAGE_CODE = 'ru-ru'

SITE_ID = 1
USE_I18N = True

comment:2 by Jannis Leidel, 15 years ago

Owner: changed from nobody to Jannis Leidel
Status: newassigned
Triage Stage: UnreviewedAccepted

comment:3 by Jannis Leidel, 15 years ago

Component: UncategorizedInternationalization

comment:4 by karsu, 15 years ago

Same error with LANGUAGE_CODE 'fi'

File "/django/views/i18n.py", line 212, in javascript_catalog
    src.append("catalog['%s'] = '%s';\n" % (javascript_quote(k), javascript_quote(unicode(v))))
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 0: ordinal not in range(128)

I'm not sure what is the character in conf/locale/fi/formats.py THOUSAND_SEPARATOR, but I think that it should be normal 'space'.

comment:5 by Jannis Leidel, 15 years ago

Resolution: fixed
Status: assignedclosed

(In [12028]) Fixed #12448 - Make sure format strings are handled correctly as unicode.

Note: See TracTickets for help on using tickets.
Back to Top