mirror of https://github.com/django/django.git
newforms: Tiny optimization to smart_unicode()
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4077 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
6dd4e6d046
commit
820d940355
|
@ -4,7 +4,7 @@ DEFAULT_ENCODING = 'utf-8' # TODO: First look at django.conf.settings, then fall
|
||||||
def smart_unicode(s):
|
def smart_unicode(s):
|
||||||
if not isinstance(s, basestring):
|
if not isinstance(s, basestring):
|
||||||
s = unicode(str(s))
|
s = unicode(str(s))
|
||||||
if not isinstance(s, unicode):
|
elif not isinstance(s, unicode):
|
||||||
s = unicode(s, DEFAULT_ENCODING)
|
s = unicode(s, DEFAULT_ENCODING)
|
||||||
return s
|
return s
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue