This section explains how to specify coding systems for use in communication with other processes.
C-x RET x coding RET
Use coding system
coding for transferring selections to and from other graphical applications (
C-x RET X coding RET
Use coding system
coding for transferring one selection—the next one—to or from another graphical application (
C-x RET p input-coding RET output-coding RET
Use coding systems
output-coding for subprocess input and output in the current buffer (
C-x RET x (
set-selection-coding-system) specifies the coding system for sending selected text to other windowing applications, and for receiving the text of selections made in other applications. This command applies to all subsequent selections, until you override it by using the command again. The command
C-x RET X (
set-next-selection-coding-system) specifies the coding system for the next selection made in Emacs or read by Emacs.
x-select-request-type specifies the data type to request from the X Window System for receiving text selections from other applications. If the value is
nil (the default), Emacs tries
COMPOUND_TEXT, in this order, and uses various heuristics to choose the more appropriate of the two results; if none of these succeed, Emacs falls back on
STRING. If the value of
x-select-request-type is one of the symbols
TEXT, Emacs uses only that request type. If the value is a list of some of these symbols, Emacs tries only the request types in the list, in order, until one of them succeeds, or until the list is exhausted.
C-x RET p (
set-buffer-process-coding-system) specifies the coding system for input and output to a subprocess. This command applies to the current buffer; normally, each subprocess has its own buffer, and thus you can use this command to specify translation to and from a particular subprocess by giving the command in the corresponding buffer.
You can also use
C-x RET c (
universal-coding-system-argument) just before the command that runs or starts a subprocess, to specify the coding system for communicating with that subprocess. See Text Coding.
The default for translation of process input and output depends on the current language environment.
locale-coding-system specifies a coding system to use when encoding and decoding system strings such as system error messages and
format-time-string formats and time stamps. That coding system is also used for decoding non-ASCII keyboard input on the X Window System and for encoding text sent to the standard output and error streams when in batch mode. You should choose a coding system that is compatible with the underlying system’s text representation, which is normally specified by one of the environment variables
LANG. (The first one, in the order specified above, whose value is nonempty is the one that determines the text representation.)