diff options
authorLuke Bonanomi <>2020-03-12 21:31:50 (GMT)
committerPratyush Yadav <>2020-03-14 17:16:40 (GMT)
commit850cf9ae961ce59c980b0c59abd3dd676fb7b7ec (patch)
parentd769dcc5cdd92e046eadee3cf878afc7ca806b14 (diff)
git-gui--askpass: coerce answers to UTF-8 on Windows
This addresses the issue where Git for Windows asks the user for a password, no credential helper is available, and then Git fails to pick up non-ASCII characters from the Git GUI helper. This can be verified e.g. via echo host= | git -c credential.helper= credential fill and then pasting some umlauts. The underlying reason is that Git for Windows tries to communicate using the UTF-8 encoding no matter what the actual current code page is. So let's indulge Git for Windows and do use that encoding. This fixes Signed-off-by: Luke Bonanomi <> Helped-by: Junio C Hamano <> Signed-off-by: Johannes Schindelin <> Signed-off-by: Pratyush Yadav <>
1 files changed, 5 insertions, 0 deletions
diff --git a/git-gui--askpass b/git-gui--askpass
index 4277f30..1c99ee8 100755
--- a/git-gui--askpass
+++ b/git-gui--askpass
@@ -56,6 +56,11 @@ proc finish {} {
+ # On Windows, force the encoding to UTF-8: it is what `git.exe` expects
+ if {$::tcl_platform(platform) eq {windows}} {
+ set ::answer [encoding convertto utf-8 $::answer]
+ }
puts $::answer
set ::rc 0