summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2011-10-11 17:36:05 +0000
committerAlex Gaynor <alex.gaynor@gmail.com>2011-10-11 17:36:05 +0000
commite35ba97740dbfe5497c2517510dc55f6aa431300 (patch)
treee423b4516b104753a3e254f3e278d926957d2592
parent4725a732e7b102636598e31fea4f683069a73086 (diff)
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
-rw-r--r--django/template/base.py2
-rw-r--r--django/utils/encoding.py4
2 files changed, 3 insertions, 3 deletions
diff --git a/django/template/base.py b/django/template/base.py
index 8642f4d4f5..86ba0301b8 100644
--- a/django/template/base.py
+++ b/django/template/base.py
@@ -817,7 +817,7 @@ class NodeList(list):
bits.append(self.render_node(node, context))
else:
bits.append(node)
- return mark_safe(''.join([force_unicode(b) for b in bits]))
+ return mark_safe(u''.join([force_unicode(b) for b in bits]))
def get_nodes_by_type(self, nodetype):
"Return a list of all nodes of the given type"
diff --git a/django/utils/encoding.py b/django/utils/encoding.py
index 96d915a433..36e0da2915 100644
--- a/django/utils/encoding.py
+++ b/django/utils/encoding.py
@@ -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