Commit ddc16585 authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

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: 's avatarHuw Davies <huw@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 44154060
......@@ -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;
}
......
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment