qt
Joined: 23 Aug 2005 Posts: 46 Location: Berlin, Germany
|
Posted: Sat Mar 17, 2007 5:03 pm Post subject: Re: UNICODE |
|
|
MERO wrote: | I need to convert a Unicode string (BSTR) to a Fortran string and back again.
The BSTR comes from COM Interface written in C++.
Question: how can I do that ?
Klaus |
There are some WinAPI functions which might help. For example:
DWORD UnicodeToBytes(
LPWSTR lpWideCharStr,
UINT cchWideChar,
LPSTR lpMultiByteStr,
UINT cchMultiByte
);
of
int WideCharToMultiByte(
UINT CodePage, // code page
DWORD dwFlags, // performance and mapping flags
LPCWSTR lpWideCharStr, // wide-character string
int cchWideChar, // number of chars in string.
LPSTR lpMultiByteStr, // buffer for new string
int cbMultiByte, // size of buffer
LPCSTR lpDefaultChar, // default for unmappable chars
LPBOOL lpUsedDefaultChar // set when default char used
);
Kind regards
Joerg Kuthe
QT software GmbH |
|