Tcl Source Code

Artifact [5b3a17aeba]
Login

Artifact 5b3a17aeba799d0712c609b545f2ee73bb1f469e:

Attachment "encoding.n.correction" to ticket [742100ffff] added by trier 2003-05-23 08:26:31.
*** doc/encoding.n.orig	Thu May 22 21:16:07 2003
--- doc/encoding.n	Thu May 22 21:17:39 2003
***************
*** 58,71 ****
  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,
  .CS
  	set s [encoding convertfrom euc-jp "\\xA4\\xCF"]
  .CE
--- 58,71 ----
  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, if executing the \fBsource\fR command when ISO8859-1 is the
! system 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,
  .CS
  	set s [encoding convertfrom euc-jp "\\xA4\\xCF"]
  .CE