Huw Davies : user32: Use the codepage associated with the input locale for WM_CHAR-type conversions .

Alexandre Julliard julliard at winehq.org
Tue May 21 13:56:27 CDT 2013


Module: wine
Branch: master
Commit: 5d5d0935ea5469e32b33c8b9c968f7b2d66f3d70
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=5d5d0935ea5469e32b33c8b9c968f7b2d66f3d70

Author: Huw Davies <huw at codeweavers.com>
Date:   Tue May 21 12:51:22 2013 +0100

user32: Use the codepage associated with the input locale for WM_CHAR-type conversions.

---

 dlls/user32/message.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/dlls/user32/message.c b/dlls/user32/message.c
index 24588ac..a6a839c 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;
 }
 
 /***********************************************************************




More information about the wine-cvs mailing list