mirror of
https://github.com/django/django.git
synced 2025-12-10 11:25:10 +00:00
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
1 changed files with 1 additions and 1 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue