X-Git-Url: https://git.hcoop.net/bpt/emacs.git/blobdiff_plain/5009803bda518652cc6f4b9fba02c0aed185c2a3..ab422c4d6899b1442cb6954c1829c1fb656b006c:/lisp/term/w32console.el diff --git a/lisp/term/w32console.el b/lisp/term/w32console.el index cd5aed3198..1a896eec4d 100644 --- a/lisp/term/w32console.el +++ b/lisp/term/w32console.el @@ -1,6 +1,6 @@ ;;; w32console.el -- Setup w32 console keys and colors. -;; Copyright (C) 2007-2011 Free Software Foundation, Inc. +;; Copyright (C) 2007-2013 Free Software Foundation, Inc. ;; Author: FSF ;; Keywords: terminals @@ -52,6 +52,18 @@ "Terminal initialization function for w32 console." ;; Share function key initialization with w32 gui frames (x-setup-function-keys (selected-frame)) + ;; Set terminal and keyboard encodings to the current OEM codepage. + (let ((oem-code-page-coding + (intern (format "cp%d" (w32-get-console-codepage)))) + (oem-code-page-output-coding + (intern (format "cp%d" (w32-get-console-output-codepage)))) + oem-cs-p oem-o-cs-p) + (setq oem-cs-p (coding-system-p oem-code-page-coding)) + (setq oem-o-cs-p (coding-system-p oem-code-page-output-coding)) + (when oem-cs-p + (set-keyboard-coding-system oem-code-page-coding) + (set-terminal-coding-system + (if oem-o-cs-p oem-code-page-output-coding oem-code-page-coding)))) (let* ((colors w32-tty-standard-colors) (color (car colors))) (tty-color-clear)