diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2003-06-24 21:24:08 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2003-06-24 21:24:08 (GMT) |
commit | 0b3bcf782c99fda3becd1a089c4bc3265f0cddaa (patch) | |
tree | 4663ca3768d9dc07512ba08afb3e9e27123d63cc /doc/encoding.n | |
parent | b2119b24ffca4e1a1c74f423a02377dc04c323d8 (diff) | |
download | tcl-0b3bcf782c99fda3becd1a089c4bc3265f0cddaa.zip tcl-0b3bcf782c99fda3becd1a089c4bc3265f0cddaa.tar.gz tcl-0b3bcf782c99fda3becd1a089c4bc3265f0cddaa.tar.bz2 |
Documented that [source] always uses the system encoding.
Diffstat (limited to 'doc/encoding.n')
-rw-r--r-- | doc/encoding.n | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/doc/encoding.n b/doc/encoding.n index 5fad056..f2ddbb7 100644 --- a/doc/encoding.n +++ b/doc/encoding.n @@ -4,7 +4,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: encoding.n,v 1.3 2000/09/07 14:27:47 poenitz Exp $ +'\" RCS: @(#) $Id: encoding.n,v 1.3.18.1 2003/06/24 21:24:08 dkf Exp $ '\" .so man.macros .TH encoding n "8.1" Tcl "Tcl Built-In Commands" @@ -59,13 +59,17 @@ characters as singe bytes and Japanese characters as two bytes. This makes it easy to embed literal strings that correspond to non-ASCII characters by simply typing the strings in place in the script. However, because the \fBsource\fR command always reads files using the -ISO8859-1 encoding, Tcl will treat each byte in the file as a separate -character that maps to the 00 page in Unicode. The -resulting Tcl strings will not contain the expected Japanese -characters. Instead, they will contain a sequence of Latin-1 -characters that correspond to the bytes of the original string. The -\fBencoding\fR command can be used to convert this string to the -expected Japanese Unicode characters. For example, +current system encoding, Tcl will only source such files correctly +when the encoding used to write the file is the same. This tends not +to be true in an internationalized setting. For example, if such a +file was sourced in North America (where the ISO8859-1 is normally +used), each byte in the file would be treated as a separate character +that maps to the 00 page in Unicode. The resulting Tcl strings will +not contain the expected Japanese characters. Instead, they will +contain a sequence of Latin-1 characters that correspond to the bytes +of the original string. The \fBencoding\fR command can be used to +convert this string to the expected Japanese Unicode characters. For +example, .CS set s [encoding convertfrom euc-jp "\\xA4\\xCF"] .CE |