Re: read Unicode data from IPropertyStorage
- From: "dragoon" <dragoon@xxxxxxxxxxxxxxxx>
- Date: Fri, 10 Aug 2007 10:05:18 -0500
This did the trick! Obviously I didn't check the value carefully :)
"Mihai N." <nmihai_year_2000@xxxxxxxxx> wrote in message
news:Xns9987EAE73E0B6MihaiN@xxxxxxxxxxxxxxxx
The PID_CODEPAGE, as explained in the article, should contain a valid
code
page number. However I am getting an invalid number (-535), it is just
getting more interesting...
-535 stored in a WORD is 0xFDE9, and 65001 stored in a WORD is also 0xFDE9
But 65001 is UTF-8 :-)
So try to convert the value you retrieve to UTF-16 using PID_CODEPAGE.
If PID_CODEPAGE is 1200, nothing to do, the string is UTF-16LE already
If PID_CODEPAGE is 1201, call _swab, the string is UTF-16BE (big-endian)
Otherwise use MultiByteToWideChar( PID_CODEPAGE, ... ) to convert.
--
Mihai Nita [Microsoft MVP, Windows - SDK]
http://www.mihai-nita.net
------------------------------------------
Replace _year_ with _ to get the real email
.
- References:
- read Unicode data from IPropertyStorage
- From: dragooon
- Re: read Unicode data from IPropertyStorage
- From: Michael Phillips, Jr.
- Re: read Unicode data from IPropertyStorage
- From: dragooon
- Re: read Unicode data from IPropertyStorage
- From: Michael Phillips, Jr.
- Re: read Unicode data from IPropertyStorage
- From: dragoon
- Re: read Unicode data from IPropertyStorage
- From: Michael Phillips, Jr.
- Re: read Unicode data from IPropertyStorage
- From: dragoon
- Re: read Unicode data from IPropertyStorage
- From: Mihai N.
- read Unicode data from IPropertyStorage
- Prev by Date: RE: read Unicode data from IPropertyStorage - continued
- Next by Date: Re: read Unicode data from IPropertyStorage - continued
- Previous by thread: Re: read Unicode data from IPropertyStorage
- Next by thread: read Unicode data from IPropertyStorage - continued
- Index(es):
Relevant Pages
|