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

Re: [PATCH] gitk: UTF-8 support

From
Junio C Hamano <junkio@cox.net>
Date
Nov 28, 2005, 00:12 UTC
Message-ID
<7vr7917hq4.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<20051124021231.nrg8448gk8w4owk8@webmail.spamcop.net>
Pavel Roskin <proski@gnu.org> writes:
Show 7 quoted lines
>> And as I suggested in another message (in the died-out thread
>> about gitweb), we could have i18n.commitEncoding in the
>> configuration to help gitk and gitweb.  I think that is the same
>> as your "other option".
>
> Yes.  Then my patch needs to be changed to set encoding to that setting and only
> if it's present.

The following patch on top of your patch has seen only very light testing, but it seems to do the right thing for my repository with utf-8 commit messages and another with euc-jp commit messages. For the latter, I needed to do:

	$ git-repo-config i18n.commitencoding euc-jp

-- >8 -- [PATCH] gitk: Use i18n.commitencoding configuration item.

Hardcoding "utf-8" in the script breaks projects that use local encoding, so allow setting i18n.commitEncoding.

Signed-off-by: Junio C Hamano <junkio@cox.net>
---
diff --git a/gitk b/gitk
index b53a5c5..2242216 100755
--- a/gitk
+++ b/gitk
@@ -3669,7 +3669,14 @@ set datemode 0
 set boldnames 0
 set diffopts "-U 5 -p"
 set wrcomcmd "git-diff-tree --stdin -p --pretty"
-set gitencoding "utf-8"
+
+set gitencoding ""
+catch {
+    set gitencoding [exec git-repo-config --get i18n.commitencoding]
+}
+if {$gitencoding == ""} {
+	set gitencoding "utf-8"
+}
 
 set mainfont {Helvetica 9}
 set textfont {Courier 9}
Previous: Pavel RoskinNext: Pavel Roskin
Message 7 of 8 in “gitk: UTF-8 support”
  1. gitk: UTF-8 supportPavel Roskin, Nov 23, 2005
  2. Junio C HamanoNov 24, 2005
  3. Paul MackerrasNov 24, 2005
  4. Pavel RoskinNov 24, 2005
  5. Junio C HamanoNov 24, 2005
  6. Pavel RoskinNov 24, 2005
  7. Junio C HamanoNov 28, 2005
  8. Pavel RoskinNov 28, 2005

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.