Zhu Jinchan <?xml:namespace prefix = o ns = "Urn:schemas-microsoft-com:office:office "/>
using GTK + recently, discovering GTK + is really a good thing, because GTK + is useful for plug-in programming and for writing Cross-platform DLLs (called shared libraries in Linux ). But using GTK + on a Windows platform is a matter of note that GTK + uses the Unicode character set, and if you compile on a Windows platform using multibyte character sets, then getting the GTK + function error message will be a bunch of garbled, Therefore, you should pay special attention to this problem when using the GTK + function with multibyte character set compilation.
however, I searched for some information on the Internet and realized that Unicode characters were converted to multibyte characters. The GTK + function G_module_error Displays the last error message for the plugin. Call function G_module_error Here for an example of how to use multibyte characters as Unicode characters:
#ifdef _DEBUG //I normally use the following code in the debugger if
(!module)
{
int nlen = MultiByteToWideChar (Cp_utf8, 0, G_module_ Error (),-1, NULL, NULL);//
LPWStr Lpwsz = new Wchar[nlen];
MultiByteToWideChar (Cp_utf8, 0, G_module_error (),-1, Lpwsz, nlen);/
int nLen1 = WideCharToMultiByte (CP_ACP, 0, LP Wsz, nlen, NULL, NULL, NULL, NULL);
LPSTR lpsz = new CHAR[NLEN1];
WideCharToMultiByte (CP_ACP, 0, Lpwsz, Nlen, lpsz, nLen1, NULL, NULL);//conversion completed to get multibyte characters
OutputDebugString (lpsz);
delete [] Lpwsz;
delete [] lpsz;
}
#endif