Kim Gräsman
2005-07-17 15:55:54 UTC
Hello,
I thought I'd use WinInet to download web page content.
I want to convert the response to Unicode (in the Win32 sense, that's UCS-2
or UTF-16, right?) so I can pass it around as a BSTR.
I need to inspect the Content-Type header to figure out the charset of the
body, don't I?
Assuming that's valid, I should be able to map iso-8859-x -> CP_ACP and UTF-8
-> CP_UTF8, and just use MultiByteToWideChar to convert the body to UCS-2.
But I suppose the charset may be just about anything described by ISO --
is there a clean translation into Windows codepages from ISO charset names?
Or does WinInet solve this transparently?
--
Best Regards,
Kim Gräsman
I thought I'd use WinInet to download web page content.
I want to convert the response to Unicode (in the Win32 sense, that's UCS-2
or UTF-16, right?) so I can pass it around as a BSTR.
I need to inspect the Content-Type header to figure out the charset of the
body, don't I?
Assuming that's valid, I should be able to map iso-8859-x -> CP_ACP and UTF-8
-> CP_UTF8, and just use MultiByteToWideChar to convert the body to UCS-2.
But I suppose the charset may be just about anything described by ISO --
is there a clean translation into Windows codepages from ISO charset names?
Or does WinInet solve this transparently?
--
Best Regards,
Kim Gräsman