Display a post in the correct character set

  • Thread starter Thread starter Simon Smith
  • Start date Start date
S

Simon Smith

Hi All -

I've got a COM add-in which is reading messages from an external source
and creating PostItems in Outlook. Some of them might be in different charsets
- e.g. KOI8-R, Russian, etc.
I can work out which codepage these should be and then I set pr_internet_cpid,
0x3FDE0003, (for KOI8-R I set it to 20866). This doesn't seems to make
any difference. I've also tried pr_message_codepage, 0x3FFD0003, and that
doesn't make a difference either, nor does setting both of them.

What am I missing?


Thanks -
 
Are you setting the plain text body or RTF? Try setting PR_RTF_COMPRESSED
and make sure "\ansicpg" RTF tag is set correctly.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
Thanks Dmitry -

I was hoping not to have to do that, but it looks as though I will after
all.
One followup, though. Will this affect the display of the subject? That
appears wrong even when the message is rendered correctly.

Thanks -
 
For the subject you need to set PR_SUBJECT_A to a string returned by
WideCharToMultiByte and set the PR_INTERNET_CPID to the correct locale.
In Outlook 2003 (it is the first fully Unicode awareOutlook version) you can
simply set the PR_SUBJECT_W property if a user if using the new Unicode
enabled PST or Exchange.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
Back
Top