Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

unicode: Fixed #4313 -- fixed a problem with unicode strings and date…


format filters.

git-svn-id: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 2cebf777e3827c4325f8e4d8e3f2d55f21b603a5 1 parent 095d3ca
@malcolmt malcolmt authored
Showing with 2 additions and 1 deletion.
  1. +2 −1  django/utils/
3  django/utils/
@@ -14,6 +14,7 @@
from django.utils.dates import MONTHS, MONTHS_3, MONTHS_AP, WEEKDAYS
from django.utils.tzinfo import LocalTimezone
from django.utils.translation import ugettext as _
+from django.utils.encoding import smart_unicode
from calendar import isleap, monthrange
import re, time
@@ -25,7 +26,7 @@ def format(self, formatstr):
pieces = []
for i, piece in enumerate(re_formatchars.split(formatstr)):
if i % 2:
- pieces.append(str(getattr(self, piece)()))
+ pieces.append(smart_unicode(getattr(self, piece)()))
elif piece:
pieces.append(re_escaped.sub(r'\1', piece))
return u''.join(pieces)
Please sign in to comment.
Something went wrong with that request. Please try again.