# [PATCH RFC] gitk: display submodule diffs with appropriate encoding

2 messages from 2010-01-05 to 2010-01-12. Participants: Kirill Smelkov, Paul Mackerras.
Thread: https://gitlist.dev/t/22100

## Kirill Smelkov, 2010-01-05 12:44

Subject: [PATCH RFC] gitk: display submodule diffs with appropriate encoding
Message-ID: <1262695494-27975-1-git-send-email-kirr@landau.phys.spbu.ru>
URL: https://gitlist.dev/e/1262695494-27975-1-git-send-email-kirr%40landau.phys.spbu.ru

```
Previsously, when submodule commits headings contained non-latin-1
characters, they were displayed incorrectly in gitk, because $line was
not properly decoded, i.e.

----------------------------- Documentation/Dokko -----------------------------
Submodule Documentation/Dokko 2ca20c7..0ea204d:
  > ÃÂÃÂÃÂ¾ÃÂÃÂ¾ÃÂºÃÂ¾ÃÂ»ÃÂ ÃÂÃÂ¾ÃÂ¿ÃÂÃÂÃÂ¶ÃÂµÃÂ½ÃÂ¸ÃÂ ÃÂÃÂÃÂ¡ "ÃÂÃÂ¾ÃÂÃÂÃÂ¸ÃÂº-21631"  (ÃÂÃÂ2 ÃÂ¸ ÃÂ¡ÃÂ°ÃÂ½ÃÂ´ÃÂ°ÃÂ»)
  > hardware: ÃÂ´ÃÂ¾ÃÂºÃÂÃÂ¼ÃÂµÃÂ½ÃÂÃÂ°ÃÂÃÂ¸ÃÂ ÃÂ½ÃÂ° InnoDisk SATA 10000
  > hardware: ÃÂ´ÃÂ¾ÃÂºÃÂÃÂ¼ÃÂµÃÂ½ÃÂÃÂ°ÃÂÃÂ¸ÃÂ ÃÂ½ÃÂ° IEI PCISA-6770E2 v3.0
  > hardware: ÃÂ´ÃÂ¾ÃÂºÃÂÃÂ¼ÃÂµÃÂ½ÃÂÃÂ°ÃÂÃÂ¸ÃÂ ÃÂ½ÃÂ° Fastwel NIB941
  > hardware: ÃÂ´ÃÂ¾ÃÂºÃÂÃÂ¼ÃÂµÃÂ½ÃÂÃÂ°ÃÂÃÂ¸ÃÂ ÃÂ½ÃÂ° IEI IPX-9S
  > hardware: ÃÂ´ÃÂ¾ÃÂºÃÂÃÂ¼ÃÂµÃÂ½ÃÂÃÂ°ÃÂÃÂ¸ÃÂ ÃÂ½ÃÂ° Hirschmann 5TX-EEC


instead of

----------------------------- Documentation/Dokko -----------------------------
Submodule Documentation/Dokko 2ca20c7..0ea204d:
  > ÐÑÐ¾ÑÐ¾ÐºÐ¾Ð»Ñ ÑÐ¾Ð¿ÑÑÐ¶ÐµÐ½Ð¸Ñ ÐÐÐ¡ "ÐÐ¾ÑÑÐ¸Ðº-21631"  (ÐÐ2 Ð¸ Ð¡Ð°Ð½Ð´Ð°Ð»)
  > hardware: Ð´Ð¾ÐºÑÐ¼ÐµÐ½ÑÐ°ÑÐ¸Ñ Ð½Ð° InnoDisk SATA 10000
  > hardware: Ð´Ð¾ÐºÑÐ¼ÐµÐ½ÑÐ°ÑÐ¸Ñ Ð½Ð° IEI PCISA-6770E2 v3.0
  > hardware: Ð´Ð¾ÐºÑÐ¼ÐµÐ½ÑÐ°ÑÐ¸Ñ Ð½Ð° Fastwel NIB941
  > hardware: Ð´Ð¾ÐºÑÐ¼ÐµÐ½ÑÐ°ÑÐ¸Ñ Ð½Ð° IEI IPX-9S
  > hardware: Ð´Ð¾ÐºÑÐ¼ÐµÐ½ÑÐ°ÑÐ¸Ñ Ð½Ð° Hirschmann 5TX-EEC


This fixes it.

Signed-off-by: Kirill Smelkov <kirr@landau.phys.spbu.ru>
---
 gitk |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/gitk b/gitk
index 86dff0f..0edef8f 100755
--- a/gitk
+++ b/gitk
@@ -7689,8 +7689,10 @@ proc getblobdiffline {bdf ids} {
 	    makediffhdr $fname $ids
 	    $ctext insert end "\n$line\n" filesep
 	} elseif {![string compare -length 3 "  >" $line]} {
+	    set line [encoding convertfrom $diffencoding $line]
 	    $ctext insert end "$line\n" dresult
 	} elseif {![string compare -length 3 "  <" $line]} {
+	    set line [encoding convertfrom $diffencoding $line]
 	    $ctext insert end "$line\n" d0
 	} elseif {$diffinhdr} {
 	    if {![string compare -length 12 "rename from " $line]} {
-- 
1.6.6.78.gbd757c.dirty

```

## Paul Mackerras, 2010-01-12 11:23

Subject: Re: [PATCH RFC] gitk: display submodule diffs with appropriate encoding
Message-ID: <20100112112302.GF6685@brick.ozlabs.ibm.com>
URL: https://gitlist.dev/e/20100112112302.GF6685%40brick.ozlabs.ibm.com
In-Reply-To: <1262695494-27975-1-git-send-email-kirr@landau.phys.spbu.ru>

```
On Tue, Jan 05, 2010 at 03:44:54PM +0300, Kirill Smelkov wrote:

> Previsously, when submodule commits headings contained non-latin-1
> characters, they were displayed incorrectly in gitk, because $line was
> not properly decoded, i.e.

Thanks, applied.

Paul.

```
