#5778: Email subjects not encoded properly
------------------------------------------------------------+---------------
Reporter: Thomas Petazzoni <[EMAIL PROTECTED]> | Owner:
nobody
Status: new |
Component: Core framework
Version: SVN |
Resolution:
Keywords: |
Stage: Accepted
Has_patch: 0 |
Needs_docs: 0
Needs_tests: 0 |
Needs_better_patch: 0
------------------------------------------------------------+---------------
Comment (by mtredinnick):
I was thinking about this some more and I'm not sure I completely
understand the problem any longer. {{{force_unicode()}}} forces the input
to a unicode object and {{{str()}}} will raise an error for any data that
isn't ASCII.
So, for example
{{{
#!python
>>> str(force_unicode('\xc3\x85ngstr\xc3\xb6m')) # A UTF-8 bytestring
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
UnicodeEncodeError: 'ascii' codec can't encode character u'\xc5' in
position 0: ordinal not in range(128)
}}}
The only way I could see this failing is if somebody had changed Python's
default encoding, which is well advertised as being something that
shouldn't be done, for exactly this sort of reason.
What is an example of a header string that is causing the problem? And
what does sys.getdefaultencoding() return?
--
Ticket URL: <http://code.djangoproject.com/ticket/5778#comment:3>
Django Code <http://code.djangoproject.com/>
The web framework for perfectionists with deadlines
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---