chan configure $f -profile tcl8
return $f
}
+ proc convertfrom args {
+ return [encoding convertfrom -profile tcl8 {*}$args]
+ }
+} else {
+ proc convertfrom args {
+ return [encoding convertfrom {*}$args]
+ }
}
######################################################################
if {[string index $fname 0] eq "\""} {
set fname [lindex $fname 0]
}
- set fname [encoding convertfrom utf-8 $fname]
+ set fname [convertfrom utf-8 $fname]
lappend treefilelist($id) $fname
}
if {![eof $gtf]} {
if {[string index $file 0] eq "\""} {
set file [lindex $file 0]
}
- set file [encoding convertfrom utf-8 $file]
+ set file [convertfrom utf-8 $file]
if {$file ne [lindex $treediff end]} {
lappend treediff $file
lappend sublist $file
global ctext curdiffstart treediffs diffencoding
global ctext_file_names jump_to_here targetline diffline
- set fname [encoding convertfrom utf-8 $fname]
+ set fname [convertfrom utf-8 $fname]
set diffencoding [get_path_encoding $fname]
set i [lsearch -exact $treediffs($ids) $fname]
if {$i >= 0} {
if {![string compare -length 5 "diff " $line]} {
if {![regexp {^diff (--cc|--git) } $line m type]} {
- set line [encoding convertfrom utf-8 $line]
+ set line [convertfrom utf-8 $line]
$ctext insert end "$line\n" hunksep
continue
}
makediffhdr $fname $ids
} elseif {![string compare -length 16 "* Unmerged path " $line]} {
- set fname [encoding convertfrom utf-8 [string range $line 16 end]]
+ set fname [convertfrom utf-8 [string range $line 16 end]]
$ctext insert end "\n"
set curdiffstart [$ctext index "end - 1c"]
lappend ctext_file_names $fname
} elseif {![string compare -length 2 "@@" $line]} {
regexp {^@@+} $line ats
- set line [encoding convertfrom $diffencoding $line]
+ set line [convertfrom $diffencoding $line]
$ctext insert end "$line\n" hunksep
if {[regexp { \+(\d+),\d+ @@} $line m nl]} {
set diffline $nl
$ctext insert end "$line\n" filesep
}
} elseif {$currdiffsubmod != "" && ![string compare -length 3 " >" $line]} {
- set line [encoding convertfrom $diffencoding $line]
+ set line [convertfrom $diffencoding $line]
$ctext insert end "$line\n" dresult
} elseif {$currdiffsubmod != "" && ![string compare -length 3 " <" $line]} {
- set line [encoding convertfrom $diffencoding $line]
+ set line [convertfrom $diffencoding $line]
$ctext insert end "$line\n" d0
} elseif {$diffinhdr} {
if {![string compare -length 12 "rename from " $line]} {
if {[string index $fname 0] eq "\""} {
set fname [lindex $fname 0]
}
- set fname [encoding convertfrom utf-8 $fname]
+ set fname [convertfrom utf-8 $fname]
set i [lsearch -exact $treediffs($ids) $fname]
if {$i >= 0} {
setinlist difffilestart $i $curdiffstart
set diffinhdr 0
return
}
- set line [encoding convertfrom utf-8 $line]
+ set line [convertfrom utf-8 $line]
$ctext insert end "$line\n" filesep
} else {
set line [string map {\x1A ^Z} \
- [encoding convertfrom $diffencoding $line]]
+ [convertfrom $diffencoding $line]]
# parse the prefix - one ' ', '-' or '+' for each parent
set prefix [string range $line 0 [expr {$diffnparents - 1}]]
set tag [expr {$diffnparents > 1? "m": "d"}]
foreach row [split $rlist "\n"] {
if {[regexp "(.*): $attr: (.*)" $row m path value]} {
if {[string index $path 0] eq "\""} {
- set path [encoding convertfrom utf-8 [lindex $path 0]]
+ set path [convertfrom utf-8 [lindex $path 0]]
}
set path_attr_cache($attr,$path) $value
}