Opened 7 years ago

Closed 7 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: jezdez
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: UI/UX:


After 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:

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

Attachments (1)

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

Download all attachments as: .zip

Change History (6)

Changed 7 years ago by ramusus

comment:1 Changed 7 years ago by ramusus

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

Additional info from

TIME_ZONE = 'Europe/Moscow'

USE_I18N = True

comment:2 Changed 7 years ago by jezdez

  • Owner changed from nobody to jezdez
  • Status changed from new to assigned
  • Triage Stage changed from Unreviewed to Accepted

comment:3 Changed 7 years ago by jezdez

  • Component changed from Uncategorized to Internationalization

comment:4 Changed 7 years ago by karsu

Same error with LANGUAGE_CODE 'fi'

File "/django/views/", 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/ THOUSAND_SEPARATOR, but I think that it should be normal 'space'.

comment:5 Changed 7 years ago by jezdez

  • Resolution set to fixed
  • Status changed from assigned to closed

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

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