2013-02-22 11:38 AM - last edited on 2023-08-02 03:25 PM by Doreena Deng
long CHANSI2Unicode ( const char* pChars, // string to convert long nChars, // number of bytes in string wchar_t* pWChars, // wide-char buffer long maxWChars, // wide char buffer length GSCharCode charCode = CC_Default // Character codepage of input CHANIS2UnicodeCacheRef* cache = NULL // can be used to cache conversion result, if called twice );First of all pWChars is not wchar_t* , but uchar_t* (unsigned short).
GS::ANIS2UnicodeCacheRef cache = 0;Should read GS::CHANSI2UnicodeCacheRef.
2013-02-22 01:38 PM
Tomasz wrote:Try converting to Unicode first (CHANSI2Unicode) and then from Unicode to UTF8 (CHUnicode2ANSI).
What is a proper way to convert a material name (const char*) to UTF8?
I cannot get CC_UTF8 it to work (x64 Win).
2013-02-22 02:45 PM
Ralph wrote:It did the trick.
Try converting to Unicode first (CHANSI2Unicode) and then from Unicode to UTF8 (CHUnicode2ANSI).