I noticed that commit messages that contain German Umlaute are not displayed correctly when I run git log
in Git Bash on Windows. Those commits were made on Ubuntu using the Terminal. Normally, commit messages are written in English but when it comes to names there is no way around, e.g. Added library by Simon Jünker.
I guess it can also be Git Bash which cannot handle the character encoding. But maybe there is a setting to force utf-8
encoding for writing and displaying text in any module (Git Gui, Git k) of Git.
What is your multi-platform character encoding setup for Git? Please, make sure to include the configuration for both platforms in your answer. You can also add MacOS.
This link showed the way to solve this issue:
Please try:
set LESSCHARSET=UTF-8
in the Windows command Shell (cmd.exe) and run the git commands again.
Try to set git config on GIT Bash prompt with one of the following commands:
git config --global i18n.commitEncoding utf8
git config --global i18n.commitEncoding cp1252
If somone in your team uses another encoding, you will have a missmatch. Petra uses utf8:
git commit -m "Petras message with umlaut ÄäÜüÖöß etc."
Karl uses cp1252:
git commit -m "Karls message with umlaut ÄäÜüÖöß etc."
Sara checks out the pushed branch and depending on her encoding she will see one of the messages wellformed and the other missformed.
git config --global i18n.commitEncoding utf8
git log -n 2 --oneline
Petras message with umlaut ÄäÜüÖöß etc.
Karls message with umlaut <C4><E4><D6><F6><DC><FC><DF> etc.
git config --global i18n.commitEncoding cp1252
git log -n 2 --oneline
Petras message with umlaut ÄäÜüÖöß etc.
Karls message with umlaut ÄäÜüÖöß etc.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With