Skip to content

Commit

Permalink
gitk: Display submodule diffs with appropriate encoding
Browse files Browse the repository at this point in the history
Previously, when submodule commit headings contained non-latin-1
characters, they were displayed incorrectly in gitk, because $line was
not properly decoded, for example:

----------------------------- 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>
Signed-off-by: Paul Mackerras <paulus@samba.org>
  • Loading branch information
Kirill Smelkov authored and Paul Mackerras committed Jan 12, 2010
1 parent fcacf48 commit 1f2cecf
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions gitk
Original file line number Diff line number Diff line change
Expand Up @@ -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]} {
Expand Down

0 comments on commit 1f2cecf

Please sign in to comment.