utf-8 support in sdk/plugin api

Charles Dye

Super Moderator
Staff member
May 20, 2008
4,202
72
Albuquerque, NM
prospero.unm.edu
If you use Printf(), Qprintf(), and QPuts(), output will be according to the //UnicodeOutput and //UTF8Output option settings. (It's worked that way for the last several versions.)

As for reading input from a file, I think you need to handle that yourself. One way is to call MultiByteToWideChar() with CodePage set to CP_UTF8.
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
4,202
72
Albuquerque, NM
prospero.unm.edu
Truth be told, I hadn't even looked at the new SDK. Now that I do look, I see a couple of functions which I don't remember seeing before:

Code:
void WINAPI UnicodeToUTF8( LPCWSTR pszUnicode, char * pszUTF8, int nLength );
/* 
    Convert a Unicode string to UTF8
    nLength = maximum length of pszASCII
*/

void WINAPI UTF8ToUnicode( const char * pszUTF8, LPWSTR pszUnicode, int nLength );
/* 
    Convert a UTF8 string to Unicode
    nLength = maximum length of pszUnicode
*/
I don't know what they do that you can't do with WideCharToMultiByte() and MultiByteToWideChar(), though.
 
Thread starter Similar threads Forum Replies Date
V Plugins 4