user32: Use MB_USEGLYPHCHARS in OemToCharBuffW().

OemToCharBuffA() is more complicated and looks like it will require a
custom table, so that is left as is.

Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
oldstable
Huw Davies 2016-09-22 11:12:37 +01:00 committed by Alexandre Julliard
parent 4415406020
commit ddc1658501
2 changed files with 13 additions and 1 deletions

View File

@ -218,7 +218,7 @@ BOOL WINAPI OemToCharBuffA( LPCSTR s, LPSTR d, DWORD len )
BOOL WINAPI OemToCharBuffW( LPCSTR s, LPWSTR d, DWORD len )
{
if (!s || !d) return FALSE;
MultiByteToWideChar( CP_OEMCP, 0, s, len, d, len );
MultiByteToWideChar( CP_OEMCP, MB_PRECOMPOSED | MB_USEGLYPHCHARS, s, len, d, len );
return TRUE;
}

View File

@ -26,6 +26,7 @@
#include "wingdi.h"
#include "winuser.h"
#include "winerror.h"
#include "winnls.h"
#define MODIFIED(rect) (rect.left == 10 && rect.right != 100 && rect.top == 10 && rect.bottom != 100)
#define EMPTY(rect) (rect.left == rect.right && rect.bottom == rect.top)
@ -746,6 +747,8 @@ static void test_CharToOem_OemToChar(void)
};
BOOL ret;
int i;
char oem;
WCHAR uni, expect;
for (i = 0; i < sizeof(tests)/sizeof(tests[0]); i++)
{
@ -807,6 +810,15 @@ static void test_CharToOem_OemToChar(void)
ok(ret == tests[i].ret, "test %d: expected %d, got %d\n", i, tests[i].ret, ret);
ok(!lstrcmpW(buf, expected), "test %d: got '%s'\n", i, wine_dbgstr_w(buf));
}
for (i = 0; i < 0x100; i++)
{
oem = i;
ret = OemToCharBuffW( &oem, &uni, 1 );
ok( ret, "%02x: returns FALSE\n", i );
MultiByteToWideChar( CP_OEMCP, MB_PRECOMPOSED | MB_USEGLYPHCHARS, &oem, 1, &expect, 1 );
ok( uni == expect, "%02x: got %04x expected %04x\n", i, uni, expect );
}
}
START_TEST(text)