Skip to content

Commit be44aee

Browse files
committed
Merge branch 'kb/unicode' into pu
2 parents 12d29c3 + ae75e1e commit be44aee

File tree

3 files changed

+12
-30
lines changed

3 files changed

+12
-30
lines changed

git-gui.sh

Lines changed: 8 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -534,28 +534,10 @@ proc _lappend_nice {cmd_var} {
534534
}
535535
536536
proc git {args} {
537-
set opt [list]
538-
539-
while {1} {
540-
switch -- [lindex $args 0] {
541-
--nice {
542-
_lappend_nice opt
543-
}
544-
545-
default {
546-
break
547-
}
548-
549-
}
550-
551-
set args [lrange $args 1 end]
552-
}
553-
554-
set cmdp [_git_cmd [lindex $args 0]]
555-
set args [lrange $args 1 end]
556-
557-
_trace_exec [concat $opt $cmdp $args]
558-
set result [eval exec $opt $cmdp $args]
537+
set fd [eval [list git_read] $args]
538+
fconfigure $fd -translation binary -encoding utf-8
539+
set result [string trimright [read $fd] "\n"]
540+
close $fd
559541
if {$::_trace} {
560542
puts stderr "< $result"
561543
}
@@ -1111,7 +1093,7 @@ git-version proc _parse_config {arr_name args} {
11111093
[list git_read config] \
11121094
$args \
11131095
[list --null --list]]
1114-
fconfigure $fd_rc -translation binary
1096+
fconfigure $fd_rc -translation binary -encoding utf-8
11151097
set buf [read $fd_rc]
11161098
close $fd_rc
11171099
}
@@ -1691,7 +1673,7 @@ proc read_diff_index {fd after} {
16911673
set i [split [string range $buf_rdi $c [expr {$z1 - 2}]] { }]
16921674
set p [string range $buf_rdi $z1 [expr {$z2 - 1}]]
16931675
merge_state \
1694-
[encoding convertfrom $p] \
1676+
[encoding convertfrom utf-8 $p] \
16951677
[lindex $i 4]? \
16961678
[list [lindex $i 0] [lindex $i 2]] \
16971679
[list]
@@ -1724,7 +1706,7 @@ proc read_diff_files {fd after} {
17241706
set i [split [string range $buf_rdf $c [expr {$z1 - 2}]] { }]
17251707
set p [string range $buf_rdf $z1 [expr {$z2 - 1}]]
17261708
merge_state \
1727-
[encoding convertfrom $p] \
1709+
[encoding convertfrom utf-8 $p] \
17281710
?[lindex $i 4] \
17291711
[list] \
17301712
[list [lindex $i 0] [lindex $i 2]]
@@ -1747,7 +1729,7 @@ proc read_ls_others {fd after} {
17471729
set pck [split $buf_rlo "\0"]
17481730
set buf_rlo [lindex $pck end]
17491731
foreach p [lrange $pck 0 end-1] {
1750-
set p [encoding convertfrom $p]
1732+
set p [encoding convertfrom utf-8 $p]
17511733
if {[string index $p end] eq {/}} {
17521734
set p [string range $p 0 end-1]
17531735
}

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

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
}

0 commit comments

Comments
 (0)