{"thread":{"id":"41488","subject":"Invalid initial git gui message encoding","startedAt":"2016-02-23T18:36:55Z","lastAt":"2016-02-23T18:36:55Z","messageCount":1,"participants":["jarek z."],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"279049","messageId":"CABvS4Ogs9biYxs-yNVxO9S5_nWiKcUO8dySWHWEfFAyaqCviJg@mail.gmail.com","threadId":"41488","inReplyTo":null,"subject":"Invalid initial git gui message encoding","fromName":"jarek z.","fromEmail":"yaras6@gmail.com","sentAt":"2016-02-23T18:36:55Z","receivedAt":"2016-02-23T18:36:55Z","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.\n\nSteps to reproduce:\n\n  git init .\n  echo 'a' > a && git add . && git commit -m 'added A'\n  git checkout -b devel\n  echo 'b' > b && git add . && git commit -m 'added B (ęóąśłżźćń)'\n  echo 'bbb' >> b && git add . && git commit -m 'changed B (żźćńąśłóę)'\n  git checkout master\n  git merge --squash devel\n\nafter above commands I run git gui where I get initial message with\ninvalid encoding. I described it more widely on github:\nhttps://github.com/git-for-windows/git/issues/664#issuecomment-187664072.\n\nI prepared a fix on https://github.com/git-for-windows/git/pull/665.\nBefore I send a patch based on git://repo.or.cz/git-gui.git may I ask\nyou to review my changes? I also attach them to this message below.\n\ndiff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh\nindex 1834f00..5771973 100755\n--- a/git-gui/git-gui.sh\n+++ b/git-gui/git-gui.sh\n@@ -1599,11 +1599,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---\nYours sincerely,\nJarek Z.\n"}]}