# HG changeset patch # User Richard M. Stallman # Date 1076979875 0 # Node ID 9706b0221102f7f66b4bf5e8b92d9fdc13bd1bce # Parent 5089d03a20615d46572d7a338cba551ce1994844 (Translation of Characters): Give examples of use. Explain about translation-table-for-input and set-buffer-file-coding-system. Minor typo fix. diff -r 5089d03a2061 -r 9706b0221102 lispref/nonascii.texi --- 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