summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorLibravatar Karsten Blees <blees@dcon.de>2012-02-04 21:54:36 +0100
committerLibravatar Pat Thoyts <patthoyts@users.sourceforge.net>2016-10-06 09:21:50 +0100
commite2039e946e6efa6c220b3cf186671f93e7aec9b9 (patch)
tree0f2a67ae9371710e2bbbf7dc3fb3b5435e0c9f96 /lib
parentMerge branch 'dr/ru' into pu (diff)
downloadtgif-e2039e946e6efa6c220b3cf186671f93e7aec9b9.tar.xz
git-gui: unicode file name support on windows
Assumes file names in git tree objects are UTF-8 encoded. On most unix systems, the system encoding (and thus the TCL system encoding) will be UTF-8, so file names will be displayed correctly. On Windows, it is impossible to set the system encoding to UTF-8. Changing the TCL system encoding (via 'encoding system ...', e.g. in the startup code) is explicitly discouraged by the TCL docs. Change git-gui functions dealing with file names to always convert from and to UTF-8. Signed-off-by: Karsten Blees <blees@dcon.de> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
Diffstat (limited to 'lib')
-rw-r--r--lib/browser.tcl2
-rw-r--r--lib/index.tcl6
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/browser.tcl b/lib/browser.tcl
index 158049353f..a982983667 100644
--- a/lib/browser.tcl
+++ b/lib/browser.tcl
@@ -197,7 +197,7 @@ method _ls {tree_id {name {}}} {
$w conf -state disabled
set fd [git_read ls-tree -z $tree_id]
- fconfigure $fd -blocking 0 -translation binary -encoding binary
+ fconfigure $fd -blocking 0 -translation binary -encoding utf-8
fileevent $fd readable [cb _read $fd]
}
diff --git a/lib/index.tcl b/lib/index.tcl
index 3a3e534aef..b588db11d9 100644
--- a/lib/index.tcl
+++ b/lib/index.tcl
@@ -115,7 +115,7 @@ proc write_update_indexinfo {fd pathList totalCnt batch after} {
set info [lindex $s 2]
if {$info eq {}} continue
- puts -nonewline $fd "$info\t[encoding convertto $path]\0"
+ puts -nonewline $fd "$info\t[encoding convertto utf-8 $path]\0"
display_file $path $new
}
@@ -186,7 +186,7 @@ proc write_update_index {fd pathList totalCnt batch after} {
?M {set new M_}
?? {continue}
}
- puts -nonewline $fd "[encoding convertto $path]\0"
+ puts -nonewline $fd "[encoding convertto utf-8 $path]\0"
display_file $path $new
}
@@ -247,7 +247,7 @@ proc write_checkout_index {fd pathList totalCnt batch after} {
?M -
?T -
?D {
- puts -nonewline $fd "[encoding convertto $path]\0"
+ puts -nonewline $fd "[encoding convertto utf-8 $path]\0"
display_file $path ?_
}
}