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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxxxxxx>
---
 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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]