Convert LPWSTR to LPSTR
-
Hi everyone, I need to convert a unicode
LPWSTR
to multi-byteLPSTR
.wcstombs
_s doesn't do good,because it replaces non-english characters to their english likes (like ş->s and ı>i).WideCharToMultiByte
function seems to do this right,but the double-byte characters in the convertedLPSTR
are interpreted as if they are two single-byte characters. to be more specific,I use MAPI dll to send an e-mail.MAPI dll expects all strings to beLPSTR
which maps toint
.but i want to use non-english characters in e-mail's body/subject/attached files' names,and couldn't find a solution yet.it's all good when strings are in english,because all unicode characters map to asigned char
then.but when i get a non-english character,"problem".LPSTR
seems to interpret all characters to be single-byte. any suggestions? -
Hi everyone, I need to convert a unicode
LPWSTR
to multi-byteLPSTR
.wcstombs
_s doesn't do good,because it replaces non-english characters to their english likes (like ş->s and ı>i).WideCharToMultiByte
function seems to do this right,but the double-byte characters in the convertedLPSTR
are interpreted as if they are two single-byte characters. to be more specific,I use MAPI dll to send an e-mail.MAPI dll expects all strings to beLPSTR
which maps toint
.but i want to use non-english characters in e-mail's body/subject/attached files' names,and couldn't find a solution yet.it's all good when strings are in english,because all unicode characters map to asigned char
then.but when i get a non-english character,"problem".LPSTR
seems to interpret all characters to be single-byte. any suggestions?ajitatif angajetor wrote:
MAPI dll expects all strings to be LPSTR which maps to int.but i want to use non-english characters in e-mail's body/subject/attached files' names,and couldn't find a solution yet
What you need is encoding. There are several types of encoding around, some standards, some more habits grown out of prolonged use. Read about MIME.
"We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation." -- Caius Petronius, Roman Consul, 66 A.D.