[ < ] [ > ]   [ << ] [Plus haut] [ >> ]         [Top] [Table des matières] [Index] [ ? ]

37.9.3 Decoding Process Output

When Emacs writes process output directly into a multibyte buffer, it decodes the output according to the process output coding system. If the coding system is raw-text or no-conversion, Emacs converts the unibyte output to multibyte using string-to-multibyte, and inserts the resulting multibyte text.

You can use set-process-coding-system to specify which coding system to use (voir la section Process Information). Otherwise, the coding system comes from coding-system-for-read, if that is non-nil; or else from the defaulting mechanism (voir la section Default Coding Systems).

Warning: Coding systems such as undecided which determine the coding system from the data do not work entirely reliably with asynchronous subprocess output. This is because Emacs has to process asynchronous subprocess output in batches, as it arrives. Emacs must try to detect the proper coding system from one batch at a time, and this does not always work. Therefore, if at all possible, specify a coding system that determines both the character code conversion and the end of line conversion—that is, one like latin-1-unix, rather than undecided or latin-1.

When Emacs calls a process filter function, it provides the process output as a multibyte string or as a unibyte string according to the process's filter multibyte flag. If the flag is non-nil, Emacs decodes the output according to the process output coding system to produce a multibyte string, and passes that to the process. If the flag is nil, Emacs puts the output into a unibyte string, with no decoding, and passes that.

When you create a process, the filter multibyte flag takes its initial value from default-enable-multibyte-characters. If you want to change the flag later on, use set-process-filter-multibyte.

Function: set-process-filter-multibyte process multibyte

This function sets the filter multibyte flag of process to multibyte.

Function: process-filter-multibyte-p process

This function returns the filter multibyte flag of process.


[ < ] [ > ]   [ << ] [Plus haut] [ >> ]         [Top] [Table des matières] [Index] [ ? ]

Ce document a été généré par Eric Reinbold le 13 Octobre 2007 en utilisant texi2html 1.78.