Package: dejagnu
Status: install ok installed
Priority: optional
Section: devel
Installed-Size: 2216
Maintainer: Daniel Jacobowitz <[EMAIL PROTECTED]>
Architecture: all
Version: 1.4.4.cvs20060709-2.2
Depends: expect


When using proc diff on two different files, diff could report them as
equal. Then problem lies i Tcl encodings. I have two files, one using
iso8859-1 encoding and the other utf-8 encoded. When opening the iso8859-1
file Tcl will autodetect the encoding to be iso8859-1 and convert it til
utf-8 in the internal representation. Using string compare on these will
make them look alike.

The solution is to set the encoding after open. Here's a patch:

*** utils.exp.old       2006-10-24 10:10:59.000000000 +0200
--- utils.exp   2006-10-24 10:11:26.000000000 +0200
***************
*** 320,325 ****
--- 320,326 ----

      if {[file exists ${file_1}]} {
          set file_a [open ${file_1} r]
+               fconfigure $file_a -encoding binary
      } else {
          warning "${file_1} doesn't exist"
          return 0
***************
*** 327,332 ****
--- 328,334 ----

      if {[file exists ${file_2}]} {
          set file_b [open ${file_2} r]
+               fconfigure $file_b -encoding binary
      } else {
          warning "${file_2} doesn't exist"
          return 0



-- 
Tore Morkemo

----------------------------------------------------------------------
          Tore Morkemo, Bibliotek-Systemer As, Larvik, Norway


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to