mirror of
https://github.com/django/django.git
synced 2025-10-25 22:56:12 +00:00
Change some string literals to be unicode, because:
* It's the most micro of optimizations (forget I even said it)
* It makes significantly more sense semantically, given these are functions which return unicode.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16957 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -81,7 +81,7 @@ def force_unicode(s, encoding='utf-8', strings_only=False, errors='strict'):
|
||||
# without raising a further exception. We do an
|
||||
# approximation to what the Exception's standard str()
|
||||
# output should be.
|
||||
s = ' '.join([force_unicode(arg, encoding, strings_only,
|
||||
s = u' '.join([force_unicode(arg, encoding, strings_only,
|
||||
errors) for arg in s])
|
||||
elif not isinstance(s, unicode):
|
||||
# Note: We use .decode() here, instead of unicode(s, encoding,
|
||||
@@ -97,7 +97,7 @@ def force_unicode(s, encoding='utf-8', strings_only=False, errors='strict'):
|
||||
# working unicode method. Try to handle this without raising a
|
||||
# further exception by individually forcing the exception args
|
||||
# to unicode.
|
||||
s = ' '.join([force_unicode(arg, encoding, strings_only,
|
||||
s = u' '.join([force_unicode(arg, encoding, strings_only,
|
||||
errors) for arg in s])
|
||||
return s
|
||||
|
||||
|
||||
Reference in New Issue
Block a user