Mercurial > emacs
changeset 102036:a99f1d1b3ddf
(User-Chosen Coding Systems): Document that select-safe-coding-system
suggests raw-text if there are raw bytes in the region.
(Explicit Encoding): Warn not to use `undecided' when encoding.
author | Eli Zaretskii <eliz@gnu.org> |
---|---|
date | Sat, 14 Feb 2009 14:11:37 +0000 |
parents | 6adcb5801c43 |
children | 53e826bf3d94 |
files | doc/lispref/nonascii.texi |
diffstat | 1 files changed, 11 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/doc/lispref/nonascii.texi Sat Feb 14 10:50:29 2009 +0000 +++ b/doc/lispref/nonascii.texi Sat Feb 14 14:11:37 2009 +0000 @@ -1187,6 +1187,10 @@ @var{from} is a string, the string specifies the text to encode, and @var{to} is ignored. +If the specified text includes raw bytes (@pxref{Text +Representations}), @code{select-safe-coding-system} suggests +@code{raw-text} for its encoding. + If @var{default-coding-system} is non-@code{nil}, that is the first coding system to try; if that can handle the text, @code{select-safe-coding-system} returns that coding system. It can @@ -1543,6 +1547,13 @@ buffer remains multibyte if it was multibyte before, and any 8-bit bytes are converted to their multibyte representation (@pxref{Text Representations}). + +@cindex @code{undecided} coding-system, when encoding +Do @emph{not} use @code{undecided} for @var{coding-system} when +encoding text, since that may lead to unexpected results. Instead, +use @code{select-safe-coding-system} (@pxref{User-Chosen Coding +Systems, select-safe-coding-system}) to suggest a suitable encoding, +if there's no obvious pertinent value for @var{coding-system}. @end deffn @defun encode-coding-string string coding-system &optional nocopy buffer