git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH] gitk: fix branch name encoding error on gitk
@ 2019-12-07  0:32 加藤一博
  2019-12-09 19:19 ` Junio C Hamano
  2019-12-15  4:29 ` Paul Mackerras
  0 siblings, 2 replies; 3+ messages in thread
From: 加藤一博 @ 2019-12-07  0:32 UTC (permalink / raw)
  To: git@vger.kernel.org; +Cc: kazuhiro kato, 加藤一博

From: Kazuhiro Kato <kazuhiro.kato@hotmail.co.jp>

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 <kato-k@ksysllc.co.jp>
---
 gitk | 4 ++++
 1 file changed, 4 insertions(+)

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]
-- 
2.20.1.windows.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-12-15  5:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-07  0:32 [PATCH] gitk: fix branch name encoding error on gitk 加藤一博
2019-12-09 19:19 ` Junio C Hamano
2019-12-15  4:29 ` Paul Mackerras

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).