{"thread":{"id":"41570","subject":"Invalid initial git gui message encoding","startedAt":"2016-02-29T17:50:04Z","lastAt":"2016-02-29T17:50:04Z","messageCount":1,"participants":["jarek z."],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"279794","messageId":"CABvS4Ohe3fKG6qcDHtryLR3Mokt44m4AM6oP0p3PisvxndO+oA@mail.gmail.com","threadId":"41570","inReplyTo":null,"subject":"Invalid initial git gui message encoding","fromName":"jarek z.","fromEmail":"yaras6@gmail.com","sentAt":"2016-02-29T17:50:04Z","receivedAt":"2016-02-29T17:50:04Z","isPatch":false,"sender":{"key":"yaras6@gmail.com","avatar":null},"body":"Hello.\n\nWorking with Git for Windows on git gui I noticed an issue on reading\ninitial message to git gui message prompt after squash or cherry-pick\nconflict. When system encoding is not set to UTF-8 (and on my Windows\nit is cp1250) squash/cherry pick conflict message gets invalid\nencoding.\n\nThis issue and test case is more widely described on\nhttps://github.com/git-for-windows/git/issues/664 . After I set\nencoding to UTF-8 using fconfigure, the problem seems to be fixed.\n\nI tried it also on Linux, but I cannot reproduce this problem as its\ndefault encoding is utf-8. I verified it using simple tcl script:\n\"puts [encoding system]\". On Windows I get:\n\n$ tclsh enc.tcl\ncp1250\n\non Linux:\n\n$ tclsh enc.tcl\nutf-8\n\nIt may be not a big issue for Linux, but I think it is worth to have\nit merged in case of somebody had other encoding than UTF-8. This fix\nhas been already merged into Git for Windows.\n\nAs stated in Documentation/SubmittingPatches, this patch is based on\ngit://repo.or.cz/git-gui.git.\n\nBTW. Is there any example of writing regression tests for git-gui?\n\nSigned-off-by: yaras <yaras6@gmail.com>\n---\n git-gui.sh | 2 ++\n 1 file changed, 2 insertions(+)\n\ndiff --git a/git-gui.sh b/git-gui.sh\nindex 11048c7..1ed5185 100755\n--- a/git-gui.sh\n+++ b/git-gui.sh\n@@ -1616,11 +1616,13 @@ proc run_prepare_commit_msg_hook {} {\n  if {[file isfile [gitdir MERGE_MSG]]} {\n  set pcm_source \"merge\"\n  set fd_mm [open [gitdir MERGE_MSG] r]\n+ fconfigure $fd_mm -encoding utf-8\n  puts -nonewline $fd_pcm [read $fd_mm]\n  close $fd_mm\n  } elseif {[file isfile [gitdir SQUASH_MSG]]} {\n  set pcm_source \"squash\"\n  set fd_sm [open [gitdir SQUASH_MSG] r]\n+ fconfigure $fd_sm -encoding utf-8\n  puts -nonewline $fd_pcm [read $fd_sm]\n  close $fd_sm\n  } else {\n--\n"}]}