[Zope3-Users] UnicodeEncodeErrors from zope/app/maildir.py
Rupert Redington
rupert at neontribe.co.uk
Tue Nov 28 10:42:42 EST 2006
I write this in expectation of needing to kick myself quite soon...
I collect some data from a form, using a Text schema/widget, get my
IMailDelivery utility (which uses queued delivery) and pass my from and
to addresses and the message data I collected from the form (with a
subject line and a couple of new lines added to the top) to the
utility's send method.
If the collected data contains characters outside the ascii set ( a UK
pound sign - for example) then I'll get an error thus:
File "/home/busstop39/Zope3/lib/python/zope/app/mail/maildir.py", line
116, in write
self._fd.write(data)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xa3' in
position 113: ordinal not in range(128)
I'm constantly aware that I need a much better grasp of character
encoding issues (and had hoped that the wonders of unicode/UTF-8 would
save me from this) - can anyone give me a pointer?
Rupert
More information about the Zope3-users
mailing list