changeset 54036:9706b0221102

(Translation of Characters): Give examples of use. Explain about translation-table-for-input and set-buffer-file-coding-system. Minor typo fix.
author Richard M. Stallman <rms@gnu.org>
date Tue, 17 Feb 2004 01:04:35 +0000
parents 5089d03a2061
children 96796d3ede2e
files lispref/nonascii.texi
diffstat 1 files changed, 14 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lispref/nonascii.texi	Tue Feb 17 00:58:59 2004 +0000
+++ b/lispref/nonascii.texi	Tue Feb 17 01:04:35 2004 +0000
@@ -17,7 +17,7 @@
 * Selecting a Representation::  Treating a byte sequence as unibyte or multi.
 * Character Codes::         How unibyte and multibyte relate to
                                 codes of individual characters.
-* Character Sets::          The space of possible characters codes
+* Character Sets::          The space of possible character codes
                                 is divided into various character sets.
 * Chars and Bytes::         More information about multibyte encodings.
 * Splitting Characters::    Converting a character to its byte sequence.
@@ -503,6 +503,14 @@
 own particular translation tables; there are also default translation
 tables which apply to all other coding systems.
 
+  For instance, the coding-system @code{utf-8} has a translation table
+that maps characters of various charsets (e.g.,
+@code{latin-iso8859-@var{x}}) into Unicode character sets.  This way,
+it can encode Latin-2 characters into UTF-8.  Meanwhile,
+@code{unify-8859-on-decoding-mode} operates by specifying
+@code{standard-translation-table-for-decode} to translate
+Latin-@var{x} characters into corresponding Unicode characters.
+
 @defun make-translation-table &rest translations
 This function returns a translation table based on the argument
 @var{translations}.  Each element of @var{translations} should be a
@@ -558,6 +566,10 @@
 Self-inserting characters are translated through this translation
 table before they are inserted.  This variable automatically becomes
 buffer-local when set.
+
+@code{set-buffer-file-coding-system} sets this variable so that your
+keyboard input gets translated into the character sets that the buffer
+is likely to contain.
 @end defvar
 
 @node Coding Systems
@@ -1065,7 +1077,7 @@
 @example
 ;; @r{Read the file with no character code conversion.}
 ;; @r{Assume @acronym{crlf} represents end-of-line.}
-(let ((coding-system-for-write 'emacs-mule-dos))
+(let ((coding-system-for-read 'emacs-mule-dos))
   (insert-file-contents filename))
 @end example