changeset 71307:b4f82229f064

(Coding Conventions): Explain use of coding systems to ensure one decoding for strings.
author Richard M. Stallman <rms@gnu.org>
date Sat, 10 Jun 2006 10:34:35 +0000
parents e31e18bcd667
children 50bf1e82432f
files lispref/tips.texi
diffstat 1 files changed, 25 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lispref/tips.texi	Sat Jun 10 10:17:41 2006 +0000
+++ b/lispref/tips.texi	Sat Jun 10 10:34:35 2006 +0000
@@ -224,6 +224,31 @@
 coherent if all libraries use the same conventions.
 
 @item
+If your program contains non-ASCII characters in string or character
+constants, you should make sure Emacs always decodes these characters
+the same way, regardless of the user's settings.  There are two ways
+to do that:
+
+@itemize -
+@item
+Use coding system @code{emacs-mule}, and specify that for
+@code{coding} in the @samp{-*-} line or the local variables list.
+
+@example
+;; XXX.el  -*- coding: emacs-mule; -*-
+@end example
+
+@item
+Use one of the coding systems based on ISO 2022 (such as
+iso-8859-@var{n} and iso-2022-7bit), and specify it with @samp{!} at
+the end for @code{coding}.  (The @samp{!} turns off any possible
+character translation.)
+
+@example
+;; XXX.el -*- coding: iso-latin-2!; -*-
+@end example
+
+@item
 Indent each function with @kbd{C-M-q} (@code{indent-sexp}) using the
 default indentation parameters.