From 5d5d0935ea5469e32b33c8b9c968f7b2d66f3d70 Mon Sep 17 00:00:00 2001 From: Huw Davies Date: Tue, 21 May 2013 12:51:22 +0100 Subject: [PATCH] user32: Use the codepage associated with the input locale for WM_CHAR-type conversions. --- dlls/user32/message.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/dlls/user32/message.c b/dlls/user32/message.c index 24588ac1a89..a6a839cb479 100644 --- a/dlls/user32/message.c +++ b/dlls/user32/message.c @@ -586,7 +586,14 @@ static BOOL CALLBACK broadcast_message_callback( HWND hwnd, LPARAM lparam ) DWORD get_input_codepage( void ) { - return CP_ACP; + DWORD cp; + int ret; + HKL hkl = GetKeyboardLayout( 0 ); + + ret = GetLocaleInfoW( LOWORD(hkl), LOCALE_IDEFAULTANSICODEPAGE | LOCALE_RETURN_NUMBER, + (WCHAR *)&cp, sizeof(cp) / sizeof(WCHAR) ); + if (!ret) cp = CP_ACP; + return cp; } /***********************************************************************