1 |
@c -*-texinfo-*- |
@c -*-texinfo-*- |
2 |
@c This is part of the GNU Emacs Lisp Reference Manual. |
@c This is part of the GNU Emacs Lisp Reference Manual. |
3 |
@c Copyright (C) 1998, 1999 Free Software Foundation, Inc. |
@c Copyright (C) 1998, 1999, 2002 Free Software Foundation, Inc. |
4 |
@c See the file elisp.texi for copying conditions. |
@c See the file elisp.texi for copying conditions. |
5 |
@setfilename ../info/characters |
@setfilename ../info/characters |
6 |
@node Non-ASCII Characters, Searching and Matching, Text, Top |
@node Non-ASCII Characters, Searching and Matching, Text, Top |
87 |
default value. Setting the local binding of |
default value. Setting the local binding of |
88 |
@code{enable-multibyte-characters} in a specific buffer is not allowed, |
@code{enable-multibyte-characters} in a specific buffer is not allowed, |
89 |
but changing the default value is supported, and it is a reasonable |
but changing the default value is supported, and it is a reasonable |
90 |
thing to do, because it has no effect on existing buffers. |
thing to do, because it has no effect on existing buffers. It can be |
91 |
|
useful to bind it around a block of code to ensure it uses unibyte |
92 |
|
consistently. |
93 |
|
|
94 |
The @samp{--unibyte} command line option does its job by setting the |
The @samp{--unibyte} command line option does its job by setting the |
95 |
default value to @code{nil} early in startup. |
default value to @code{nil} early in startup. |
319 |
This function returns the charset property list of the character set |
This function returns the charset property list of the character set |
320 |
@var{charset}. Although @var{charset} is a symbol, this is not the same |
@var{charset}. Although @var{charset} is a symbol, this is not the same |
321 |
as the property list of that symbol. Charset properties are used for |
as the property list of that symbol. Charset properties are used for |
322 |
special purposes within Emacs; for example, |
special purposes within Emacs. |
|
@code{preferred-coding-system} helps determine which coding system to |
|
|
use to encode characters in a charset. |
|
323 |
@end defun |
@end defun |
324 |
|
|
325 |
@node Chars and Bytes |
@node Chars and Bytes |
570 |
conversion. @code{no-conversion} is equivalent to @code{raw-text-unix}: |
conversion. @code{no-conversion} is equivalent to @code{raw-text-unix}: |
571 |
it specifies no conversion of either character codes or end-of-line. |
it specifies no conversion of either character codes or end-of-line. |
572 |
|
|
573 |
The coding system @code{emacs-mule} specifies that the data is |
The coding system @code{utf-8-emacs} specifies that the data is |
574 |
represented in the internal Emacs encoding. This is like |
represented in the internal Emacs encoding. This is like |
575 |
@code{raw-text} in that no code conversion happens, but different in |
@code{raw-text} in that no code conversion happens, but different in |
576 |
that the result is multibyte data. |
that the result is multibyte data. |
578 |
@defun coding-system-get coding-system property |
@defun coding-system-get coding-system property |
579 |
This function returns the specified property of the coding system |
This function returns the specified property of the coding system |
580 |
@var{coding-system}. Most coding system properties exist for internal |
@var{coding-system}. Most coding system properties exist for internal |
581 |
purposes, but one that you might find useful is @code{mime-charset}. |
purposes, but one that you might find useful is @code{:mime-charset}. |
582 |
That property's value is the name used in MIME for the character coding |
That property's value is the name used in MIME for the character coding |
583 |
which this coding system can read and write. Examples: |
which this coding system can read and write. Examples: |
584 |
|
|
585 |
@example |
@example |
586 |
(coding-system-get 'iso-latin-1 'mime-charset) |
(coding-system-get 'iso-latin-1 :mime-charset) |
587 |
@result{} iso-8859-1 |
@result{} iso-8859-1 |
588 |
(coding-system-get 'iso-2022-cn 'mime-charset) |
(coding-system-get 'iso-2022-cn :mime-charset) |
589 |
@result{} iso-2022-cn |
@result{} iso-2022-cn |
590 |
(coding-system-get 'cyrillic-koi8 'mime-charset) |
(coding-system-get 'cyrillic-koi8 :mime-charset) |
591 |
@result{} koi8-r |
@result{} koi8-r |
592 |
@end example |
@end example |
593 |
|
|
594 |
The value of the @code{mime-charset} property is also defined |
The value of the @code{:mime-charset} property is also defined as an |
595 |
as an alias for the coding system. |
alias for the coding system, but normally coding system base names |
596 |
|
should be the same as the MIME charset (lowercased). |
597 |
@end defun |
@end defun |
598 |
|
|
599 |
@node Encoding and I/O |
@node Encoding and I/O |
940 |
@example |
@example |
941 |
;; @r{Read the file with no character code conversion.} |
;; @r{Read the file with no character code conversion.} |
942 |
;; @r{Assume @sc{crlf} represents end-of-line.} |
;; @r{Assume @sc{crlf} represents end-of-line.} |
943 |
(let ((coding-system-for-write 'emacs-mule-dos)) |
(let ((coding-system-for-write 'utf-8-emacs-dos)) |
944 |
(insert-file-contents filename)) |
(insert-file-contents filename)) |
945 |
@end example |
@end example |
946 |
|
|