i am trying to set up some scheduled tasks which will have to send emails.
the email-content is to be rendered by kid and then passed to an instance of TurboMail.Message
the template is rendered correctly, but when passing it to the message, i receive encoding errors. UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 67: ordinal not in range(128).
what can i do about that? i think i´m using the latest version of turbomail 2.0.3
> the template is rendered correctly, but when passing it to the > message, i receive encoding errors. > UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position > 67: ordinal not in range(128).
once I have had the same error-message (working with an utf-8 encoded database)
it was solved by creating the file /usr/lib64/python2.4/site-packages/sitecustomize.py containing the two following lines : import sys sys.setdefaultencoding("utf-8")
but this can disturb your non utf-8 python-scripts
> > the template is rendered correctly, but when passing it to the > > message, i receive encoding errors. > > UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position > > 67: ordinal not in range(128).
> once I have had the same error-message (working with an utf-8 encoded > database)
> it was solved by creating the file > /usr/lib64/python2.4/site-packages/sitecustomize.py > containing the two following lines : > import sys > sys.setdefaultencoding("utf-8")
> but this can disturb your non utf-8 python-scripts
> > the template is rendered correctly, but when passing it to the > > message, i receive encoding errors. > > UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position > > 67: ordinal not in range(128).
> once I have had the same error-message (working with an utf-8 encoded > database)
> it was solved by creating the file > /usr/lib64/python2.4/site-packages/sitecustomize.py > containing the two following lines : > import sys > sys.setdefaultencoding("utf-8")
> but this can disturb your non utf-8 python-scripts
Because of this it's a really bad advice. Don't do that!
On Wednesday 02 May 2007 13:51, Johnny Blonde wrote:
> Hello Group,
> i am trying to set up some scheduled tasks which will have to send > emails.
> the email-content is to be rendered by kid and then passed to an > instance of TurboMail.Message
> the template is rendered correctly, but when passing it to the > message, i receive encoding errors. > UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position > 67: ordinal not in range(128).
> what can i do about that? i think i´m using the latest version of > turbomail 2.0.3
Showing us the code would help. I'm sending utf-8-encoded emails just fine using TurboMail & don't have to tweak the systems default encoding.
> On Wednesday 02 May 2007 13:51, Johnny Blonde wrote:
> > Hello Group,
> > i am trying to set up some scheduled tasks which will have to send > > emails.
> > the email-content is to be rendered by kid and then passed to an > > instance of TurboMail.Message
> > the template is rendered correctly, but when passing it to the > > message, i receive encoding errors. > > UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position > > 67: ordinal not in range(128).
> > what can i do about that? i think i´m using the latest version of > > turbomail 2.0.3
> Showing us the code would help. I'm sending utf-8-encoded emails just fine > using TurboMail & don't have to tweak the systems default encoding.