The principal purpose of coding systems is for use in reading and
writing files. The function insert-file-contents
uses
a coding system for decoding the file data, and write-region
uses one to encode the buffer contents.
You can specify the coding system to use either explicitly
(see section Specifying a Coding System for One Operation), or implicitly using the defaulting
mechanism (see section Default Coding Systems). But these methods may not
completely specify what to do. For example, they may choose a coding
system such as undefined
which leaves the character code
conversion to be determined from the data. In these cases, the I/O
operation finishes the job of choosing a coding system. Very often
you will want to find out afterwards which coding system was chosen.
write-region
. When those operations ask the
user to specify a different coding system,
buffer-file-coding-system
is updated to the coding system
specified.
write-region
. When saving the buffer asks the
user to specify a different coding system, and
save-buffer-coding-system
was used, then it is updated to the
coding system that was specified.
Warning: Since receiving subprocess output sets this variable, it can change whenever Emacs waits; therefore, you should use copy the value shortly after the function call which stores the value you are interested in.
The variable selection-coding-system
specifies how to encode
selections for the window system. See section Window System Selections.
Go to the first, previous, next, last section, table of contents.