1
0
mirror of https://github.com/django/django.git synced 2025-07-03 17:29:12 +00:00

unicode: Fixed an encoding problem that was showing up on non-English versions

of Windows (where timezone strings are different to POSIX systems).


git-svn-id: http://code.djangoproject.com/svn/django/branches/unicode@5532 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Malcolm Tredinnick 2007-06-25 12:56:52 +00:00
parent 0ced8b0bb2
commit 9c5994743c

View File

@ -2,6 +2,7 @@
import time
from datetime import timedelta, tzinfo
from django.utils.encoding import smart_unicode
class FixedOffset(tzinfo):
"Fixed offset in minutes east from UTC."
@ -25,7 +26,7 @@ class LocalTimezone(tzinfo):
"Proxy timezone information from time module."
def __init__(self, dt):
tzinfo.__init__(self, dt)
self._tzname = unicode(time.tzname[self._isdst(dt)])
self._tzname = smart_unicode(time.tzname[self._isdst(dt)])
def __repr__(self):
return self._tzname