Skip to content
This repository was archived by the owner on Nov 9, 2017. It is now read-only.

Commit ffa9869

Browse files
committed
Merge 'unicode' into HEAD
2 parents 24bbb38 + b7d7da5 commit ffa9869

File tree

4 files changed

+19
-15
lines changed

4 files changed

+19
-15
lines changed

git-gui/git-gui.sh

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -548,6 +548,9 @@ proc git {args} {
548548
549549
_trace_exec [concat $opt $cmdp $args]
550550
set result [eval exec $opt $cmdp $args]
551+
if {[encoding system] != "utf-8"} {
552+
set result [encoding convertfrom utf-8 [encoding convertto $result]]
553+
}
551554
if {$::_trace} {
552555
puts stderr "< $result"
553556
}
@@ -1104,7 +1107,7 @@ git-version proc _parse_config {arr_name args} {
11041107
[list git_read config] \
11051108
$args \
11061109
[list --null --list]]
1107-
fconfigure $fd_rc -translation binary
1110+
fconfigure $fd_rc -translation binary -encoding utf-8
11081111
set buf [read $fd_rc]
11091112
close $fd_rc
11101113
}
@@ -1682,7 +1685,7 @@ proc read_diff_index {fd after} {
16821685
set i [split [string range $buf_rdi $c [expr {$z1 - 2}]] { }]
16831686
set p [string range $buf_rdi $z1 [expr {$z2 - 1}]]
16841687
merge_state \
1685-
[encoding convertfrom $p] \
1688+
[encoding convertfrom utf-8 $p] \
16861689
[lindex $i 4]? \
16871690
[list [lindex $i 0] [lindex $i 2]] \
16881691
[list]
@@ -1715,7 +1718,7 @@ proc read_diff_files {fd after} {
17151718
set i [split [string range $buf_rdf $c [expr {$z1 - 2}]] { }]
17161719
set p [string range $buf_rdf $z1 [expr {$z2 - 1}]]
17171720
merge_state \
1718-
[encoding convertfrom $p] \
1721+
[encoding convertfrom utf-8 $p] \
17191722
?[lindex $i 4] \
17201723
[list] \
17211724
[list [lindex $i 0] [lindex $i 2]]
@@ -1738,7 +1741,7 @@ proc read_ls_others {fd after} {
17381741
set pck [split $buf_rlo "\0"]
17391742
set buf_rlo [lindex $pck end]
17401743
foreach p [lrange $pck 0 end-1] {
1741-
set p [encoding convertfrom $p]
1744+
set p [encoding convertfrom utf-8 $p]
17421745
if {[string index $p end] eq {/}} {
17431746
set p [string range $p 0 end-1]
17441747
}

git-gui/lib/browser.tcl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ method _ls {tree_id {name {}}} {
197197
$w conf -state disabled
198198

199199
set fd [git_read ls-tree -z $tree_id]
200-
fconfigure $fd -blocking 0 -translation binary -encoding binary
200+
fconfigure $fd -blocking 0 -translation binary -encoding utf-8
201201
fileevent $fd readable [cb _read $fd]
202202
}
203203

git-gui/lib/index.tcl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ proc write_update_indexinfo {fd pathList totalCnt batch after} {
115115
set info [lindex $s 2]
116116
if {$info eq {}} continue
117117

118-
puts -nonewline $fd "$info\t[encoding convertto $path]\0"
118+
puts -nonewline $fd "$info\t[encoding convertto utf-8 $path]\0"
119119
display_file $path $new
120120
}
121121

@@ -186,7 +186,7 @@ proc write_update_index {fd pathList totalCnt batch after} {
186186
?M {set new M_}
187187
?? {continue}
188188
}
189-
puts -nonewline $fd "[encoding convertto $path]\0"
189+
puts -nonewline $fd "[encoding convertto utf-8 $path]\0"
190190
display_file $path $new
191191
}
192192

@@ -247,7 +247,7 @@ proc write_checkout_index {fd pathList totalCnt batch after} {
247247
?M -
248248
?T -
249249
?D {
250-
puts -nonewline $fd "[encoding convertto $path]\0"
250+
puts -nonewline $fd "[encoding convertto utf-8 $path]\0"
251251
display_file $path ?_
252252
}
253253
}

gitk-git/gitk

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7557,7 +7557,7 @@ proc gettreeline {gtf id} {
75577557
if {[string index $fname 0] eq "\""} {
75587558
set fname [lindex $fname 0]
75597559
}
7560-
set fname [encoding convertfrom $fname]
7560+
set fname [encoding convertfrom utf-8 $fname]
75617561
lappend treefilelist($id) $fname
75627562
}
75637563
if {![eof $gtf]} {
@@ -7819,7 +7819,7 @@ proc gettreediffline {gdtf ids} {
78197819
if {[string index $file 0] eq "\""} {
78207820
set file [lindex $file 0]
78217821
}
7822-
set file [encoding convertfrom $file]
7822+
set file [encoding convertfrom utf-8 $file]
78237823
if {$file ne [lindex $treediff end]} {
78247824
lappend treediff $file
78257825
lappend sublist $file
@@ -7964,7 +7964,7 @@ proc makediffhdr {fname ids} {
79647964
global ctext curdiffstart treediffs diffencoding
79657965
global ctext_file_names jump_to_here targetline diffline
79667966

7967-
set fname [encoding convertfrom $fname]
7967+
set fname [encoding convertfrom utf-8 $fname]
79687968
set diffencoding [get_path_encoding $fname]
79697969
set i [lsearch -exact $treediffs($ids) $fname]
79707970
if {$i >= 0} {
@@ -8021,7 +8021,7 @@ proc parseblobdiffline {ids line} {
80218021

80228022
if {![string compare -length 5 "diff " $line]} {
80238023
if {![regexp {^diff (--cc|--git) } $line m type]} {
8024-
set line [encoding convertfrom $line]
8024+
set line [encoding convertfrom utf-8 $line]
80258025
$ctext insert end "$line\n" hunksep
80268026
continue
80278027
}
@@ -8068,7 +8068,7 @@ proc parseblobdiffline {ids line} {
80688068
makediffhdr $fname $ids
80698069

80708070
} elseif {![string compare -length 16 "* Unmerged path " $line]} {
8071-
set fname [encoding convertfrom [string range $line 16 end]]
8071+
set fname [encoding convertfrom utf-8 [string range $line 16 end]]
80728072
$ctext insert end "\n"
80738073
set curdiffstart [$ctext index "end - 1c"]
80748074
lappend ctext_file_names $fname
@@ -8123,7 +8123,7 @@ proc parseblobdiffline {ids line} {
81238123
if {[string index $fname 0] eq "\""} {
81248124
set fname [lindex $fname 0]
81258125
}
8126-
set fname [encoding convertfrom $fname]
8126+
set fname [encoding convertfrom utf-8 $fname]
81278127
set i [lsearch -exact $treediffs($ids) $fname]
81288128
if {$i >= 0} {
81298129
setinlist difffilestart $i $curdiffstart
@@ -8142,6 +8142,7 @@ proc parseblobdiffline {ids line} {
81428142
set diffinhdr 0
81438143
return
81448144
}
8145+
set line [encoding convertfrom utf-8 $line]
81458146
$ctext insert end "$line\n" filesep
81468147

81478148
} else {
@@ -11952,7 +11953,7 @@ proc cache_gitattr {attr pathlist} {
1195211953
foreach row [split $rlist "\n"] {
1195311954
if {[regexp "(.*): $attr: (.*)" $row m path value]} {
1195411955
if {[string index $path 0] eq "\""} {
11955-
set path [encoding convertfrom [lindex $path 0]]
11956+
set path [encoding convertfrom utf-8 [lindex $path 0]]
1195611957
}
1195711958
set path_attr_cache($attr,$path) $value
1195811959
}

0 commit comments

Comments
 (0)