diff options
| author | Craig Jennings <c@cjennings.net> | 2024-04-07 13:41:34 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2024-04-07 13:41:34 -0500 |
| commit | 754bbf7a25a8dda49b5d08ef0d0443bbf5af0e36 (patch) | |
| tree | f1190704f78f04a2b0b4c977d20fe96a828377f1 /devdocs/elisp/decoding-output.html | |
new repository
Diffstat (limited to 'devdocs/elisp/decoding-output.html')
| -rw-r--r-- | devdocs/elisp/decoding-output.html | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/devdocs/elisp/decoding-output.html b/devdocs/elisp/decoding-output.html new file mode 100644 index 00000000..ff5c35e1 --- /dev/null +++ b/devdocs/elisp/decoding-output.html @@ -0,0 +1,6 @@ + <h4 class="subsection">Decoding Process Output</h4> <p>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 <code>raw-text</code> or <code>no-conversion</code>, Emacs converts the unibyte output to multibyte using <code>string-to-multibyte</code>, and inserts the resulting multibyte text. </p> <p>You can use <code>set-process-coding-system</code> to specify which coding system to use (see <a href="process-information">Process Information</a>). Otherwise, the coding system comes from <code>coding-system-for-read</code>, if that is non-<code>nil</code>; or else from the defaulting mechanism (see <a href="default-coding-systems">Default Coding Systems</a>). If the text output by a process contains null bytes, Emacs by default uses <code>no-conversion</code> for it; see <a href="lisp-and-coding-systems">inhibit-null-byte-detection</a>, for how to control this behavior. </p> <p><strong>Warning:</strong> Coding systems such as <code>undecided</code>, 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 <code>latin-1-unix</code>, rather than <code>undecided</code> or <code>latin-1</code>. </p> <p>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 coding system. Emacs decodes the output according to the process output coding system, which usually produces a multibyte string, except for coding systems such as <code>binary</code> and <code>raw-text</code>. </p><div class="_attribution"> + <p class="_attribution-p"> + Copyright © 1990-1996, 1998-2022 Free Software Foundation, Inc. <br>Licensed under the GNU GPL license.<br> + <a href="https://www.gnu.org/software/emacs/manual/html_node/elisp/Decoding-Output.html" class="_attribution-link">https://www.gnu.org/software/emacs/manual/html_node/elisp/Decoding-Output.html</a> + </p> +</div> |
