Re: [PATCH] gitk: fix branch name encoding error on gitk
From: Junio C Hamano <hidden>
Date: 2019-12-09 19:19:30
[jc: pinging the gitk maintainer] 加藤一博 [off-list ref] writes:
From: Kazuhiro Kato <redacted>
Kato-san, do you prefer this address, over ksysllc address? Either way, we prefer to see it match the address used on the signed-off-by line below.
After "git checkout -b '漢字'" to create a branch with UTF-8 character in it, "gitk" shows the branch name incorrectly, as it forgets to turn the bytes read from the "git show-ref" command into Unicode characters. Signed-off-by: Kazuhiro Kato <redacted> --- gitk | 4 ++++ 1 file changed, 4 insertions(+)
Thanks.
quoted hunk
diff --git a/gitk b/gitk index abe4805..3f61a5b 100755 --- a/gitk +++ b/gitk@@ -1780,11 +1780,15 @@ proc readrefs {} { global otherrefids idotherrefs mainhead mainheadid global selecthead selectheadid global hideremotes + global tclencoding foreach v {tagids idtags headids idheads otherrefids idotherrefs} { unset -nocomplain $v } set refd [open [list | git show-ref -d] r] + if {$tclencoding != {}} { + fconfigure $refd -encoding $tclencoding + } while {[gets $refd line] >= 0} { if {[string index $line 40] ne " "} continue set id [string range $line 0 39]