2012/11/1 andriyko <
ahry...@gmail.com>:
>
> I work on email&mbox libraries for RF.
> Encountered a problem with MIME objects with custom charsets and encodings.
>
> In Python
>
> from_header = email.header.Header()
> from_header.append(u'Петро')
> from_header.append('<
so...@mail.com>')
> msg['From']=from_header
>
> An attempt to use Петро in txt file
> UnicodeEncodeError: 'ascii' codec can't encode characters in position
It is possible have non-ASCII characters both in Python code and in
Robot Framework data. With Python code you need to specify the source
code encoding explicitly [1], and with Robot data you just must use
UTF-8 encoding.
[1]
http://www.python.org/dev/peps/pep-0263/
Cheers,
.peke
--
Agile Tester/Developer/Consultant ::
http://eliga.fi
Lead Developer of Robot Framework ::
http://robotframework.org