Re: read Unicode data from IPropertyStorage



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


.



Relevant Pages

  • Re: read Unicode data from IPropertyStorage
    ... However I am getting an invalid number, ... But 65001 is UTF-8 :-) ... So try to convert the value you retrieve to UTF-16 using PID_CODEPAGE. ... Replace _year_ with _ to get the real email ...
    (microsoft.public.win32.programmer.ole)
  • RE: Can anyone help with e-postage on labels?
    ... The trick is you have to select an address before you can print epostage. ... for some reason, Microsoft's link within the 'envelope' screen is invalid. ...
    (microsoft.public.word.application.errors)
  • Re: Badly cut out safe areas
    ... The Beeb do the same trick with their remaining 'steam powered' English regional news programmes and all BBC news footage shot as 4:3 is presented the same way. ... Please replace invalid and invalid with gmx and net to reply. ...
    (uk.tech.digital-tv)
  • SUMMARY: RE: nic speed
    ... This does the trick: ... kstat ce:0 | grep link ... > operation failed: Invalid argument ...
    (SunManagers)