author | Junio C Hamano <junkio@cox.net> | |
Mon, 7 May 2007 21:47:14 +0000 (14:47 -0700) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Mon, 7 May 2007 21:47:14 +0000 (14:47 -0700) |
* 'master' of git://repo.or.cz/git-gui:
git-gui: Correctly handle UTF-8 encoded commit messages
git-gui: Correctly handle UTF-8 encoded commit messages
git-gui/git-gui.sh | patch | blob | history |
diff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh
index 677c5393fdf3447ab2221e2096d75f5286ec0e45..0ad2815d1086d3843fbb093cc3d984aee4f63e3f 100755 (executable)
--- a/git-gui/git-gui.sh
+++ b/git-gui/git-gui.sh
@@ -1067,8 +1067,8 @@ You are currently in the middle of a merge that has not been fully completed. Y
set enc [string tolower [string range $line 9 end]]
}
}
- fconfigure $fd -encoding $enc
- set msg [string trim [read $fd]]
+ set msg [encoding convertfrom $enc [read $fd]]
+ set msg [string trim $msg]
close $fd
} err]} {
error_popup "Error loading commit data for amend:\n\n$err"
if {[catch {set enc $repo_config(i18n.commitencoding)}]} {
set enc utf-8
}
- fconfigure $msg_wt -encoding $enc -translation binary
- puts -nonewline $msg_wt $msg
+ fconfigure $msg_wt -encoding binary -translation binary
+ puts -nonewline $msg_wt [encoding convertto $enc $msg]
close $msg_wt
# -- Create the commit.
incr i
}
+ set author_name {}
+ set author_email {}
+ set author_time {}
+ catch {set author_name $blame_data($w,$cmit,author)}
+ catch {set author_email $blame_data($w,$cmit,author-mail)}
+ catch {set author_time [clock format $blame_data($w,$cmit,author-time)]}
+
+ set committer_name {}
+ set committer_email {}
+ set committer_time {}
+ catch {set committer_name $blame_data($w,$cmit,committer)}
+ catch {set committer_email $blame_data($w,$cmit,committer-mail)}
+ catch {set committer_time [clock format $blame_data($w,$cmit,committer-time)]}
+
if {[catch {set msg $blame_data($w,$cmit,message)}]} {
set msg {}
catch {
set enc [string tolower [string range $line 9 end]]
}
}
- fconfigure $fd -encoding $enc
- set msg [string trim [read $fd]]
+ set msg [encoding convertfrom $enc [read $fd]]
+ set msg [string trim $msg]
close $fd
+
+ set author_name [encoding convertfrom $enc $author_name]
+ set committer_name [encoding convertfrom $enc $committer_name]
+
+ set blame_data($w,$cmit,author) $author_name
+ set blame_data($w,$cmit,committer) $committer_name
}
set blame_data($w,$cmit,message) $msg
}
- set author_name {}
- set author_email {}
- set author_time {}
- catch {set author_name $blame_data($w,$cmit,author)}
- catch {set author_email $blame_data($w,$cmit,author-mail)}
- catch {set author_time [clock format $blame_data($w,$cmit,author-time)]}
-
- set committer_name {}
- set committer_email {}
- set committer_time {}
- catch {set committer_name $blame_data($w,$cmit,committer)}
- catch {set committer_email $blame_data($w,$cmit,committer-mail)}
- catch {set committer_time [clock format $blame_data($w,$cmit,committer-time)]}
-
$w_cmit insert end "commit $cmit\n"
$w_cmit insert end "Author: $author_name $author_email $author_time\n"
$w_cmit insert end "Committer: $committer_name $committer_email $committer_time\n"