Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git and PowerShell and German umlauts

I've been struggling with trying to teach msysgit how to deal with German umlauts (ä ö ü) in e.g. commit comments. No luck .....

So I thought I might try to use PowerShell and its git integration instead (PoshGit). But again - no luck:

D:\temp\test [ +12 ~0 -0 !]> git add --all

D:\temp\test [ +12 ~0 -0]> git commit -m "Einige Dateien hinzugefügt"
  Warning: commit message does not conform to UTF-8.
  You may want to amend it after fixing the message, or set the config
  variable i18n.commitencoding to the encoding your project uses.
  [master (root-commit) 085b7d6] Einige Dateien hinzugef?gt
     12 files changed, 3320 insertions(+), 0 deletions(-)

("Einige Dateien hinzugefügt" = some files added)

Interesting - I could have sworn that the German umlauts are part of the UTF-8 standard..... hmm......

And sure enough:

D:\temp\test [master]> git log

  085b7d6 (HEAD, master) Einige Dateien hinzugef<FC>gt [Marc Scheuner] [4 seconds ago]

No banana :-(

WHAT ON EARTH do I have to do to get either msysgit (the "Git bash") or PowerShell to cooperate with Git on the commit comments? I'm not even asking for supporting file names with Umlauts... just the comments (pure text) for now.....

Also: putting this

[i18n]
commitencoding = ISO-8859-1
logoutputencoding = ISO-8859-1

into my .gitconfig also doesn't seem to have any effect on my commit comments and git log .... :-(

Any ideas? Thoughts? Pointers??

like image 316
marc_s Avatar asked Jan 20 '12 21:01

marc_s


4 Answers

There's an unofficial installer for the experimental Unicode version of msysgit which you might want to give a try. Feedback to that installer is appreciated on the msysgit mailing list.

like image 198
sschuberth Avatar answered Nov 03 '22 02:11

sschuberth


I have the same problem (I'm from Sweden). Seems that if you use Git Extensions and commit through that the umlaut characters are fine. I use:

 [i18n]
 commitencoding = windows-1252
 logoutputencoding = Windows-1252
 filesEncoding = Windows-1252

Would love a solution to the powershell/command line problem though.

like image 20
Cros Avatar answered Nov 03 '22 02:11

Cros


There known quirks and issues with MSysGit and unicode as well as simple casing. Instead of struggling with this, if I were in your shoes, I would use VritualBox with a small Linux server image (no need for desktop), and use a shared directory between host and guest OSes. This way you can use Git in Linux but develop on Windows. Open a terminal to remote to the server and you can alt+TAB to the window just like you would with MSysGit.

like image 1
Adam Dymitruk Avatar answered Nov 03 '22 01:11

Adam Dymitruk


I had the same problem with git using command line via PUTTY. My solution was: Change the PUTTY-configuration for the character-set as described here: http://thegreyblog.blogspot.de/2009/08/configuring-putty-to-use-utf-8.html

After I changed the character-set in the config of PUTTY to UTF-8 the error disappeared.

BTW: Like Miklos Krivan wrote in his anwer: Other people had this problem also because their username was with umlauts in .gitconfig.

like image 1
SusiMage Avatar answered Nov 03 '22 00:11

SusiMage