summaryrefslogtreecommitdiffstats
path: root/doc/encoding.n
diff options
context:
space:
mode:
Diffstat (limited to 'doc/encoding.n')
-rw-r--r--doc/encoding.n20
1 files changed, 12 insertions, 8 deletions
diff --git a/doc/encoding.n b/doc/encoding.n
index 5fad056..fcbb67f 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.4 2003/06/24 21:26:02 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