I am trying to execute the code for multilingual support. Hence I need to handle non-english languages on English OS(here Win2K3). Now the problem is when I pass any non english characters(I have tried with Japanese) instead of passing the non-english characters it is converting it to ?????. I have confirmed its not display problem but when memcpy is called the value inside is getting changed. The value being passed through char* pData is in the form of UNICODE value, still it is converting into wrong values.

Can some one help me to understand why memcpy is converting the value? Does memcpy internally uses default code page value? How can I pass the correct value to the wide char pointer?

I have already tried wcscpy, RtlCopyMemory. I am not sure what Code Page to pass if MultiByteToWideChar is used such that it will support all the languages.

Waiting for some input ASAP.

Thanks

August 17th, 2010, 01:27 AM

Alex F

Re: How do I pass non-english characters from char* to whcar_t* on English OS

You cannot use copy function since every byte must be converted to two bytes. Use MultiByteToWideChar and select code page according to the language of converted text.