UTF oddity

Jan Sporbeck jan at sporbeck-family.de
Thu May 8 11:44:08 CDT 2003


Hallo,

while porting a friends windows code, i encountered the following:

WideCharToMultiByte returns incorrect string length when using CP_UTF8 
for conversion

the following code snippet correctly sets nLen1 to 2 but sets nLen2 only
to 1

int nLen1 = WideCharToMultiByte(CP_UTF8, 0, L"Ü", 1, NULL, 0, NULL, NULL);
// query buffer size
int nLen2 = WideCharToMultiByte(CP_UTF8, 0, L"Ü", 1, szUtf, nLen1, NULL, 
NULL);
// do conversion


I tested this with Wine <=20030408

am I missing something?


/jan.
-- 
##
Every cloud engenders not a storm.
		-- William Shakespeare, "Henry VI"
##




More information about the wine-devel mailing list