aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman2003-07-22 15:15:20 +0000
committerRichard M. Stallman2003-07-22 15:15:20 +0000
commit131bf943644db99c59a783050ab78d70e4bae2cc (patch)
treef73209ff6cdb06c29061bd66559fe0e1766e0066
parent7370e0a883b48e66b815f131f3b9b610a20d8491 (diff)
downloademacs-131bf943644db99c59a783050ab78d70e4bae2cc.tar.gz
emacs-131bf943644db99c59a783050ab78d70e4bae2cc.zip
(Converting Representations): Add string-to-multibyte.
(Translation of Characters): Add translation-table-for-input. (Default Coding Systems): Add auto-coding-functions. (Explicit Encoding): Add decode-coding-inserted-region. (Locales): Add locale-info.
-rw-r--r--lispref/nonascii.texi66
1 files changed, 66 insertions, 0 deletions
diff --git a/lispref/nonascii.texi b/lispref/nonascii.texi
index 888c5cba796..12f3afd5f4d 100644
--- a/lispref/nonascii.texi
+++ b/lispref/nonascii.texi
@@ -191,6 +191,12 @@ The function @code{unibyte-char-to-multibyte} is used to convert
191each unibyte character to a multibyte character. 191each unibyte character to a multibyte character.
192@end defun 192@end defun
193 193
194@defun string-to-multibyte string
195This function returns a multibyte string containing the same sequence
196of character codes as @var{string}. If @var{string} is a multibyte
197string, the value is the equal to @var{string}.
198@end defun
199
194@node Selecting a Representation 200@node Selecting a Representation
195@section Selecting a Representation 201@section Selecting a Representation
196 202
@@ -505,6 +511,11 @@ This is the default translation table for encoding, for
505coding systems that don't specify any other translation table. 511coding systems that don't specify any other translation table.
506@end defvar 512@end defvar
507 513
514@defvar translation-table-for-input
515Self-inserting characters are translated through this translation
516table before they are inserted.
517@end defvar
518
508@node Coding Systems 519@node Coding Systems
509@section Coding Systems 520@section Coding Systems
510 521
@@ -887,6 +898,22 @@ The value should be a cons cell of the form @code{(@var{input-coding}
887the subprocess, and @var{output-coding} applies to output to it. 898the subprocess, and @var{output-coding} applies to output to it.
888@end defvar 899@end defvar
889 900
901@defvar auto-coding-functions
902This variable holds a list of functions that try to determine a
903coding system for a file based on its undecoded contents.
904
905Each function in this list should be written to look at text in the
906current buffer, but should not modify it in any way. The buffer will
907contain undecoded text of parts of the file. Each function should
908take one argument, @var{size}, which tells it how many characters to
909look at, starting from point. If the function succeeds in determining
910a coding system for the file, it should return that coding system.
911Otherwise, it should return @code{nil}.
912
913If a file has a @samp{coding:} tag, that takes precedence, so these
914functions won't be called.
915@end defvar
916
890@defun find-operation-coding-system operation &rest arguments 917@defun find-operation-coding-system operation &rest arguments
891This function returns the coding system to use (by default) for 918This function returns the coding system to use (by default) for
892performing @var{operation} with @var{arguments}. The value has this 919performing @var{operation} with @var{arguments}. The value has this
@@ -1040,6 +1067,17 @@ decoded text. To make explicit decoding useful, the contents of
1040string is acceptable. 1067string is acceptable.
1041@end defun 1068@end defun
1042 1069
1070@defun decode-coding-inserted-region from to filename &optional visit beg end replace
1071This function decodes the text from @var{from} to @var{to} as if
1072it were being read from file @var{filename} using @code{insert-file-contents}
1073using the rest of the arguments provided.
1074
1075The normal way to use this function is after reading text from a file
1076without decoding, if you decide you would rather have decoded it.
1077Instead of deleting the text and reading it again, this time with
1078decoding, you can call this function.
1079@end defun
1080
1043@node Terminal I/O Encoding 1081@node Terminal I/O Encoding
1044@subsection Terminal I/O Encoding 1082@subsection Terminal I/O Encoding
1045 1083
@@ -1235,3 +1273,31 @@ conventions of a different language. If the variable is @code{nil}, the
1235locale is specified by environment variables in the usual POSIX fashion. 1273locale is specified by environment variables in the usual POSIX fashion.
1236@end defvar 1274@end defvar
1237 1275
1276@defun locale-info item
1277This function returns locale data @var{item} for the current POSIX
1278locale, if available. @var{item} should be one of these symbols:
1279
1280@table @code
1281@item codeset
1282Return the character set as a string (locale item @code{CODESET}).
1283
1284@item days
1285Return a 7-element vector of day names (locale items
1286@code{DAY_1} through @code{DAY_7});
1287
1288@item months
1289Return a 12-element vector of month names (locale items @code{MON_1}
1290through @code{MON_12}).
1291
1292@item paper
1293Return a list @code{(@var{width} @var{height})} for the default paper
1294size measured in milimeters (locale items @code{PAPER_WIDTH} and
1295@code{PAPER_HEIGHT}).
1296@end table
1297
1298If the system can't provide the requested information, or if
1299@var{item} is not one of those symbols, the value is @code{nil}. All
1300strings in the return value are decoded using
1301@code{locale-coding-system}. @xref{Locales,,, libc, GNU Libc Manual},
1302for more information about locales and locale items.
1303@end defun