summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 95e706b)
raw | patch | inline | side by side (parent: 95e706b)
author | Alexander Gavrilov <angavrilov@gmail.com> | |
Sat, 6 Dec 2008 17:24:35 +0000 (20:24 +0300) | ||
committer | Shawn O. Pearce <spearce@spearce.org> | |
Mon, 8 Dec 2008 16:33:05 +0000 (08:33 -0800) |
Commits without an encoding header are supposed to
be encoded in utf8. While this apparently hasn't always
been the case, currently it is the active convention, so
it is better to follow it; otherwise people who have to
use commitEncoding on their machines are unable to read
utf-8 commits made by others.
I also think that it is preferrable to display the warning
about an unsupported value of commitEncoding more prominently,
because this condition may lead to surprising behavior and,
eventually, to loss of data.
Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
be encoded in utf8. While this apparently hasn't always
been the case, currently it is the active convention, so
it is better to follow it; otherwise people who have to
use commitEncoding on their machines are unable to read
utf-8 commits made by others.
I also think that it is preferrable to display the warning
about an unsupported value of commitEncoding more prominently,
because this condition may lead to surprising behavior and,
eventually, to loss of data.
Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
lib/blame.tcl | patch | blob | history | |
lib/commit.tcl | patch | blob | history |
diff --git a/lib/blame.tcl b/lib/blame.tcl
index c1cd7f3b92fddb60be9fe261d7b75c5df85b60c1..1f3b08f9efff873631d73e128ee97c1b9dad1822 100644 (file)
--- a/lib/blame.tcl
+++ b/lib/blame.tcl
catch {
set fd [git_read cat-file commit $cmit]
fconfigure $fd -encoding binary -translation lf
- if {[catch {set enc $repo_config(i18n.commitencoding)}]} {
- set enc utf-8
- }
+ # By default commits are assumed to be in utf-8
+ set enc utf-8
while {[gets $fd line] > 0} {
if {[string match {encoding *} $line]} {
set enc [string tolower [string range $line 9 end]]
diff --git a/lib/commit.tcl b/lib/commit.tcl
index 334514996a9e900d124b5fdc54f83dc9924517b5..9cc84105952d02f0171be0e23f0a82373bae0545 100644 (file)
--- a/lib/commit.tcl
+++ b/lib/commit.tcl
if {[catch {
set fd [git_read cat-file commit $curHEAD]
fconfigure $fd -encoding binary -translation lf
- if {[catch {set enc $repo_config(i18n.commitencoding)}]} {
- set enc utf-8
- }
+ # By default commits are assumed to be in utf-8
+ set enc utf-8
while {[gets $fd line] > 0} {
if {[string match {parent *} $line]} {
lappend parents [string range $line 7 end]
if {$use_enc ne {}} {
fconfigure $msg_wt -encoding $use_enc
} else {
- puts stderr [mc "warning: Tcl does not support encoding '%s'." $enc]
+ error_popup [mc "warning: Tcl does not support encoding '%s'." $enc]
fconfigure $msg_wt -encoding utf-8
}
puts $msg_wt $msg