summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2007-04-27 08:29:08 +0000
committerMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2007-04-27 08:29:08 +0000
commit080cebaf69891f4b2b575a1e9fd7ceb4d2170623 (patch)
tree98688f65a0dbf9d8ddad73fdc10405d6b8890162
parentee0bc3b6c8e34d4785cf3fc9aec78161df2b1d19 (diff)
unicode: Changed StrAndUnicode class to be consistent with everything else as
to the encoding of bytestrings. git-svn-id: http://code.djangoproject.com/svn/django/branches/unicode@5101 bcc190cf-cafb-0310-a4f2-bffc1f526a37
-rw-r--r--django/utils/encoding.py7
1 files changed, 2 insertions, 5 deletions
diff --git a/django/utils/encoding.py b/django/utils/encoding.py
index eb6b63660e..402b946e65 100644
--- a/django/utils/encoding.py
+++ b/django/utils/encoding.py
@@ -47,13 +47,10 @@ def smart_str(s, encoding='utf-8', strings_only=False):
class StrAndUnicode(object):
"""
- A class whose __str__ returns its __unicode__ as a bytestring
- according to settings.DEFAULT_CHARSET.
+ A class whose __str__ returns its __unicode__ as a UTF-8 bytestring.
Useful as a mix-in.
"""
def __str__(self):
- # XXX: (Malcolm) Correct encoding? Be variable and use UTF-8 as
- # default?
- return self.__unicode__().encode(settings.DEFAULT_CHARSET)
+ return self.__unicode__().encode('utf-8')