44
chan configure $f -profile tcl8
45
return $f
46
}
47
+ proc convertfrom args {
48
+ return [encoding convertfrom -profile tcl8 {*}$args]
49
+ }
50
+} else {
51
+ proc convertfrom args {
52
+ return [encoding convertfrom {*}$args]
53
+ }
54
}
55
56
######################################################################
7830
if {[string index $fname 0] eq "\""} {
7831
set fname [lindex $fname 0]
7832
}
7826
- set fname [encoding convertfrom utf-8 $fname]
7833
+ set fname [convertfrom utf-8 $fname]
7834
lappend treefilelist($id) $fname
7835
}
7836
if {![eof $gtf]} {
8090
if {[string index $file 0] eq "\""} {
8091
set file [lindex $file 0]
8092
}
8086
- set file [encoding convertfrom utf-8 $file]
8093
+ set file [convertfrom utf-8 $file]
8094
if {$file ne [lindex $treediff end]} {
8095
lappend treediff $file
8096
lappend sublist $file
8226
global ctext curdiffstart treediffs diffencoding
8227
global ctext_file_names jump_to_here targetline diffline
8228
8222
- set fname [encoding convertfrom utf-8 $fname]
8229
+ set fname [convertfrom utf-8 $fname]
8230
set diffencoding [get_path_encoding $fname]
8231
set i [lsearch -exact $treediffs($ids) $fname]
8232
if {$i >= 0} {
8288
8289
if {![string compare -length 5 "diff " $line]} {
8290
if {![regexp {^diff (--cc|--git) } $line m type]} {
8284
- set line [encoding convertfrom utf-8 $line]
8291
+ set line [convertfrom utf-8 $line]
8292
$ctext insert end "$line\n" hunksep
8293
continue
8294
}
8337
makediffhdr $fname $ids
8338
8339
} elseif {![string compare -length 16 "* Unmerged path " $line]} {
8333
- set fname [encoding convertfrom utf-8 [string range $line 16 end]]
8340
+ set fname [convertfrom utf-8 [string range $line 16 end]]
8341
$ctext insert end "\n"
8342
set curdiffstart [$ctext index "end - 1c"]
8343
lappend ctext_file_names $fname
8350
8351
} elseif {![string compare -length 2 "@@" $line]} {
8352
regexp {^@@+} $line ats
8346
- set line [encoding convertfrom $diffencoding $line]
8353
+ set line [convertfrom $diffencoding $line]
8354
$ctext insert end "$line\n" hunksep
8355
if {[regexp { \+(\d+),\d+ @@} $line m nl]} {
8356
set diffline $nl
8379
$ctext insert end "$line\n" filesep
8380
}
8381
} elseif {$currdiffsubmod != "" && ![string compare -length 3 " >" $line]} {
8375
- set line [encoding convertfrom $diffencoding $line]
8382
+ set line [convertfrom $diffencoding $line]
8383
$ctext insert end "$line\n" dresult
8384
} elseif {$currdiffsubmod != "" && ![string compare -length 3 " <" $line]} {
8378
- set line [encoding convertfrom $diffencoding $line]
8385
+ set line [convertfrom $diffencoding $line]
8386
$ctext insert end "$line\n" d0
8387
} elseif {$diffinhdr} {
8388
if {![string compare -length 12 "rename from " $line]} {
8390
if {[string index $fname 0] eq "\""} {
8391
set fname [lindex $fname 0]
8392
}
8386
- set fname [encoding convertfrom utf-8 $fname]
8393
+ set fname [convertfrom utf-8 $fname]
8394
set i [lsearch -exact $treediffs($ids) $fname]
8395
if {$i >= 0} {
8396
setinlist difffilestart $i $curdiffstart
8409
set diffinhdr 0
8410
return
8411
}
8405
- set line [encoding convertfrom utf-8 $line]
8412
+ set line [convertfrom utf-8 $line]
8413
$ctext insert end "$line\n" filesep
8414
8415
} else {
8416
set line [string map {\x1A ^Z} \
8410
- [encoding convertfrom $diffencoding $line]]
8417
+ [convertfrom $diffencoding $line]]
8418
# parse the prefix - one ' ', '-' or '+' for each parent
8419
set prefix [string range $line 0 [expr {$diffnparents - 1}]]
8420
set tag [expr {$diffnparents > 1? "m": "d"}]
12286
foreach row [split $rlist "\n"] {
12287
if {[regexp "(.*): $attr: (.*)" $row m path value]} {
12288
if {[string index $path 0] eq "\""} {
12282
- set path [encoding convertfrom utf-8 [lindex $path 0]]
12289
+ set path [convertfrom utf-8 [lindex $path 0]]
12290
}
12291
set path_attr_cache($attr,$path) $value
12292
}