[python-win32] Win32 Python Extensions Outlook.Application Question
pramod.vaidyanathan at gmail.com
Wed Sep 17 13:41:59 CEST 2008
Thanks for your quick reply. I'm probably confused. I'll give that a try.
On Wed, Sep 17, 2008 at 7:38 AM, Tim Golden <mail at timgolden.me.uk> wrote:
> Pramod Vaidyanathan wrote:
>> The problem comes down to this. I have an email that I have received in
>> Microsoft Outlook that contains characters outside of the ascii set. I was
>> able to use your library to traverse through my outlook folders and select
>> the appropriate emails etc. There are characters in the email that are
>> ascii, extended ascii, and other. The problem I am having is when I read
>> the "item.Body" into body, the characters "\xe2\x85\x9b", "\xe2\x85\x9c",
>> "\xe2\x85\x9d", "\xe2\x85\x9d" become unknown characters (question marks).
>> These characters have unicode equivalents of u215b, u215c, u215d, and
>> u215e. They are the fractions 1/8, 3/8, 5/8, 7/8 respectively.
> I'm not sure whether you're confused or I am.
> Just to clarify: the Body attribute of an Outlook
> MailItem is returned to Python as a unicode object.
> In my case (having sent myself an email containing the
> characters you mention) it looks like this:
> Exactly how these chars will be output will depend on your
> console, locale settings etc. If you want to replace
> those as decimals, you can simply do this, eg:
> body = message.Body.replace (u"\u215b", u"0.125")
> You don't need to encode it to anything unless
> you have some other reason to do that.
> python-win32 mailing list
> python-win32 at python.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the python-win32