Changeset 5101
- Timestamp:
- 04/27/07 03:29:08 (2 years ago)
- Files:
-
- django/branches/unicode/django/utils/encoding.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/branches/unicode/django/utils/encoding.py
r4971 r5101 48 48 class StrAndUnicode(object): 49 49 """ 50 A class whose __str__ returns its __unicode__ as a bytestring 51 according to settings.DEFAULT_CHARSET. 50 A class whose __str__ returns its __unicode__ as a UTF-8 bytestring. 52 51 53 52 Useful as a mix-in. 54 53 """ 55 54 def __str__(self): 56 # XXX: (Malcolm) Correct encoding? Be variable and use UTF-8 as 57 # default? 58 return self.__unicode__().encode(settings.DEFAULT_CHARSET) 55 return self.__unicode__().encode('utf-8') 59 56
