MAPI/Outlook contacts encoding

M

mtimony1

Hi all,

I'm somewhat confused about what encoding I should expect contracts
retrieved through MAPI (from Outlook) to be in, whether they're
address book entries or IPF.Contact entries.

I haven't specified MAPI_UNICODE to any of the MAPI functions because
most of them just return errors when I do that. Nevertheless, I seem
to be getting back contacts containing non-ASCII characters.

If MAPI returns non-ASCII strings, are they always supposed to be in
Unicode? Or can they be in some other encoding? And if so, how do I
figure out what the encoding is? Will it always be the default system
encoding? Does Outlook always use a certain encoding? Or is there some
API?

Thanks!
Mark
 
D

Dmitry Streblechenko

Where exactly did you specify MAPI_UNICODE?
You need to check whether the store natively supports Unicode by checking if
the STORE_UNICODE_OK bit is set in the PR_STORE_SUPPORT_MASK property. If it
is, request the Unicode (PT_UNICODE) flavor of the string property. If not,
ask for the ANSI version of the property, and convert it to Unicode using
MultibyteToWideChar function using the value of the PR_INTERNET_CPID
property or (if PR_INTERNET_CPID is not set) the active code page (GetACP).

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top