summaryrefslogtreecommitdiff
path: root/lib/blame.tcl
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2007-07-19 05:13:29 (GMT)
committerShawn O. Pearce <spearce@spearce.org>2007-07-19 05:27:17 (GMT)
commitc4638f662c9ba5f4150ab97dbbf0e540392aad55 (patch)
tree283c0585a75b48df5a1ee12a730ffb213be8f8db /lib/blame.tcl
parentd36cd968378cd3e509434b1b9f43f1417fdba57e (diff)
downloadgit-c4638f662c9ba5f4150ab97dbbf0e540392aad55.zip
git-c4638f662c9ba5f4150ab97dbbf0e540392aad55.tar.gz
git-c4638f662c9ba5f4150ab97dbbf0e540392aad55.tar.bz2
git-gui: Translate standard encoding names to Tcl ones
This is a essentially a copy of Paul Mackerras encoding support from gitk. I stole the code from gitk commit fd8ccbec4f0161, as Paul has already done all of the hard work setting up this translation table. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'lib/blame.tcl')
-rw-r--r--lib/blame.tcl19
1 files changed, 12 insertions, 7 deletions
diff --git a/lib/blame.tcl b/lib/blame.tcl
index 1bcb4b4..4da60ac 100644
--- a/lib/blame.tcl
+++ b/lib/blame.tcl
@@ -771,15 +771,20 @@ method _showcommit {cur_w lno} {
set enc [string tolower [string range $line 9 end]]
}
}
- set msg [encoding convertfrom $enc [read $fd]]
- set msg [string trim $msg]
+ set msg [read $fd]
close $fd
- set author_name [encoding convertfrom $enc $author_name]
- set committer_name [encoding convertfrom $enc $committer_name]
-
- set header($cmit,author) $author_name
- set header($cmit,committer) $committer_name
+ set enc [tcl_encoding $enc]
+ if {$enc ne {}} {
+ set msg [encoding convertfrom $enc $msg]
+ set author_name [encoding convertfrom $enc $author_name]
+ set committer_name [encoding convertfrom $enc $committer_name]
+ set header($cmit,author) $author_name
+ set header($cmit,committer) $committer_name
+ set header($cmit,summary) \
+ [encoding convertfrom $enc $header($cmit,summary)]
+ }
+ set msg [string trim $msg]
}
set header($cmit,message) $msg
}