diff options
author | Eli Zaretskii <eliz@gnu.org> | 2012-07-28 19:57:57 +0300 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2012-07-28 19:57:57 +0300 |
commit | 01bd1b0df605d644ae31e8f1f81d926a5d8c7099 (patch) | |
tree | 4831ac9d45815c50fe276079dd5edb7cb8e63ef8 /src/w32console.c | |
parent | a5c66610be0d94045c417dde54f8ffadd26977b5 (diff) | |
download | emacs-01bd1b0df605d644ae31e8f1f81d926a5d8c7099.tar.gz |
Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
src/w32inevt.c: Include w32inevt.h.
(w32_read_console_input): New inline function, calls either
ReadConsoleInputA or ReadConsoleInputW, depending on the value of
w32_console_unicode_input.
(fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
(w32_kbd_patch_key, key_event): Use the codepage returned by
GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
(key_event): use uChar.UnicodeChar only if
w32_console_unicode_input is non-zero.
src/w32console.c: Include w32heap.h.
<w32_console_unicode_input>: New global variable.
(initialize_w32_display): Set w32_console_unicode_input to 1 on NT
family of Windows, zero otherwise.
src/w32inevt.h: Declare w32_console_unicode_input.
lisp/international/mule-cmds.el (set-locale-environment): In a
console session on MS-Windows, set up keyboard and terminal
encoding from the OEM codepage, not the ANSI codepage.
Diffstat (limited to 'src/w32console.c')
-rw-r--r-- | src/w32console.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/w32console.c b/src/w32console.c index 42d89cca6d7..c3a1c5d86b3 100644 --- a/src/w32console.c +++ b/src/w32console.c @@ -37,6 +37,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ #include "termhooks.h" #include "termchar.h" #include "dispextern.h" +#include "w32heap.h" /* for os_subtype */ #include "w32inevt.h" /* from window.c */ @@ -67,6 +68,7 @@ static CONSOLE_CURSOR_INFO prev_console_cursor; #endif HANDLE keyboard_handle; +int w32_console_unicode_input; /* Setting this as the ctrl handler prevents emacs from being killed when @@ -786,6 +788,11 @@ initialize_w32_display (struct terminal *term) info.srWindow.Left); } + if (os_subtype == OS_NT) + w32_console_unicode_input = 1; + else + w32_console_unicode_input = 0; + /* Setup w32_display_info structure for this frame. */ w32_initialize_display_info (build_string ("Console")); |