Return the correct character count in DBCS locales.

This commit is contained in:
Mike McCormack 2004-08-26 18:11:06 +00:00 committed by Alexandre Julliard
parent 97551bcef5
commit fea1a84572
1 changed files with 7 additions and 1 deletions

View File

@ -778,7 +778,13 @@ static LRESULT LISTBOX_GetText( LB_DESCR *descr, INT index, LPARAM lParam, BOOL
if (HAS_STRINGS(descr))
{
if (!lParam)
return strlenW(descr->items[index].str);
{
DWORD len = strlenW(descr->items[index].str);
if( unicode )
return len;
return WideCharToMultiByte( CP_ACP, 0, descr->items[index].str, len,
NULL, 0, NULL, NULL );
}
TRACE("index %d (0x%04x) %s\n", index, index, debugstr_w(descr->items[index].str));