In <[EMAIL PROTECTED]>, neoedmund
wrote:
> john , you can look my code:
> it downloads email and save to local filesystem(filename and email
> contains non-english characters)
> it works now.
> but i still think python's unicode string is not as straightforward as
> java's
> string SHOULD always b
john , you can look my code:
it downloads email and save to local filesystem(filename and email
contains non-english characters)
it works now.
but i still think python's unicode string is not as straightforward as
java's
string SHOULD always be unicode. or i'm trouble dealing them when they
are in
neoedmund wrote:
[top-posting corrected]
> John Machin wrote:
> > neoedmund wrote:
> > > i want to get the subject from email and construct a filename with the
> > > subject.
> > > but tried a lot, always got error like this:
> > > UnicodeDecodeError: 'ascii' codec can't decode byte 0xe9 in positi
thank you John and Diez.
i found
fn = "%s/%s-%s.mail"%("d:/mail", "12345", '\xe6\xb5\x8b\xe8\xaf\x95' )
is ok
fn = "%s/%s-%s.mail"%(u"d:/mail", "12345", '\xe6\xb5\x8b\xe8\xaf\x95' )
results:
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe6 in position 0:
ordinal not in range(128)
So "str"%(
neoedmund wrote:
> i want to get the subject from email and construct a filename with the
> subject.
> but tried a lot, always got error like this:
> UnicodeDecodeError: 'ascii' codec can't decode byte 0xe9 in position 4:
> ordinal not in range(128)
>
>
> msg = email.message_from_string( text
neoedmund schrieb:
> i want to get the subject from email and construct a filename with the
> subject.
> but tried a lot, always got error like this:
> UnicodeDecodeError: 'ascii' codec can't decode byte 0xe9 in position 4:
> ordinal not in range(128)
>
>
> msg = email.message_from_string(
i want to get the subject from email and construct a filename with the
subject.
but tried a lot, always got error like this:
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe9 in position 4:
ordinal not in range(128)
msg = email.message_from_string( text )
title = decode_hea