#12435 closed (fixed)
UnicodeEncodeError trying to use non-english letters for format string of date filter
Reported by: | lupus | Owned by: | Jannis Leidel |
---|---|---|---|
Component: | Internationalization | Version: | dev |
Severity: | Keywords: | date filter decode error | |
Cc: | Triage Stage: | Accepted | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
When i use |date:"d.m.Y в H:i", where "в" is russian letter, i get the following:
Original Traceback (most recent call last): File "/home/.../django/template/debug.py", line 72, in render_node result = node.render(context) File "/home/.../django/template/debug.py", line 88, in render output = self.filter_expression.resolve(context) File "/home/.../django/template/__init__.py", line 580, in resolve new_obj = func(obj, *arg_vals) File "/home/.../django/template/defaultfilters.py", line 689, in date return date_format(value, arg) File "/home/.../django/utils/formats.py", line 54, in date_format return dateformat.format(value, get_format(format or 'DATE_FORMAT')) File "/home/.../django/utils/formats.py", line 47, in get_format return getattr(settings, format_type) UnicodeEncodeError: 'ascii' codec can't encode character u'\u0432' in position 6: ordinal not in range(128)
Language code in settings.py is set to 'ru-ru'
Using rev 11969
Change History (3)
comment:1 by , 15 years ago
milestone: | → 1.2 |
---|---|
Owner: | changed from | to
Status: | new → assigned |
Triage Stage: | Unreviewed → Accepted |
comment:2 by , 15 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Note:
See TracTickets
for help on using tickets.
(In [12057]) Fixed #12435 - Handle Unicode characters in format strings correctly.