git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 2/2] fix: when resolving merge conflicts, japanese file names become garbled.

From
KGKazuhiro Kato via GitGitGadget <gitgitgadget@gmail.com>
Date
Feb 18, 2025, 22:42 UTC
Message-ID
<c698805f088e0643e5faf027d4eaa6de14d6c1ff.1739918546.git.gitgitgadget@gmail.com>
In-Reply-To
<pull.1886.git.git.1739918546.gitgitgadget@gmail.com>
From: Kazuhiro Kato <kazuhiro.kato@hotmail.co.jp>
Signed-off-by: Kazuhiro Kato <kazuhiro.kato@hotmail.co.jp>
---
 gitk-git/gitk | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/gitk-git/gitk b/gitk-git/gitk
index 88951ed2384..f4f8dbd5fad 100755
--- a/gitk-git/gitk
+++ b/gitk-git/gitk
@@ -8205,12 +8205,13 @@ proc parseblobdiffline {ids line} {
 
         if {$type eq "--cc"} {
             # start of a new file in a merge diff
-            set fname [string range $line 10 end]
+            set fname_raw [string range $line 10 end]
+            set fname [encoding convertfrom $fname_raw]
             if {[lsearch -exact $treediffs($ids) $fname] < 0} {
                 lappend treediffs($ids) $fname
                 add_flist [list $fname]
             }
-
+            set fname $fname_raw
         } else {
             set line [string range $line 11 end]
             # If the name hasn't changed the length will be odd,
@@ -8310,6 +8311,7 @@ proc parseblobdiffline {ids line} {
             set diffinhdr 0
             return
         }
+        set line [encoding convertfrom $line]
         $ctext insert end "$line\n" filesep
 
     } else {
-- 
gitgitgadget
Previous: Junio C HamanoNext: Junio C Hamano
Message 5 of 7 in “gitk: Fixing file name encoding issues.”
  1. 0/2 gitk: Fixing file name encoding issues.Kazuhiro Kato via GitGitGadget, Feb 18, 2025
  2. 1/2 Fixing file name encoding issues.Kazuhiro Kato via GitGitGadget, Feb 18, 2025
  3. Konstantin KhomoutovFeb 19, 2025
  4. Junio C HamanoFeb 19, 2025
  5. 2/2 fix: when resolving merge conflicts, japanese file names become garbled.Kazuhiro Kato via GitGitGadget, Feb 18, 2025
  6. Junio C HamanoFeb 19, 2025
  7. Junio C HamanoFeb 18, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.