Use coding system coding for terminal output
Use coding system coding for keyboard input
The command C-x RET t (
specifies the coding system for terminal output. If you specify a
character code for terminal output, all characters output to the
terminal are translated into that coding system.
This feature is useful for certain character-only terminals built to support specific languages or character sets—for example, European terminals that support one of the ISO Latin character sets. You need to specify the terminal coding system when using multibyte text, so that Emacs knows which characters the terminal can actually handle.
By default, output to the terminal is not translated at all, unless Emacs can deduce the proper coding system from your terminal type or your locale specification (see Language Environments).
The command C-x RET k (
or the variable
keyboard-coding-system, specifies the coding
system for keyboard input. Character-code translation of keyboard
input is useful for terminals with keys that send non-ASCII
graphic characters—for example, some terminals designed for ISO
Latin-1 or subsets of it.
By default, keyboard input is translated based on your system locale
setting. If your terminal does not really support the encoding
implied by your locale (for example, if you find it inserts a
non-ASCII character if you type M-i), you will need to set
nil to turn off encoding.
You can do this by putting
in your init file.
keyboard-coding-system has no effect on MS-Windows,
except on old Windows 9X systems, in which case the encoding must
match the current codepage of the MS-Windows console, which can be
changed by calling
There is a similarity between using a coding system translation for keyboard input, and using an input method: both define sequences of keyboard input that translate into single characters. However, input methods are designed to be convenient for interactive use by humans, and the sequences that are translated are typically sequences of ASCII printing characters. Coding systems typically translate sequences of non-graphic characters.