mirror of
https://github.com/django/django.git
synced 2025-07-04 09:49: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:
parent
0ced8b0bb2
commit
9c5994743c
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
import time
|
import time
|
||||||
from datetime import timedelta, tzinfo
|
from datetime import timedelta, tzinfo
|
||||||
|
from django.utils.encoding import smart_unicode
|
||||||
|
|
||||||
class FixedOffset(tzinfo):
|
class FixedOffset(tzinfo):
|
||||||
"Fixed offset in minutes east from UTC."
|
"Fixed offset in minutes east from UTC."
|
||||||
@ -25,7 +26,7 @@ class LocalTimezone(tzinfo):
|
|||||||
"Proxy timezone information from time module."
|
"Proxy timezone information from time module."
|
||||||
def __init__(self, dt):
|
def __init__(self, dt):
|
||||||
tzinfo.__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):
|
def __repr__(self):
|
||||||
return self._tzname
|
return self._tzname
|
||||||
|
Loading…
x
Reference in New Issue
Block a user