简体   繁体   中英

How to configure git encoding for German Umlaute on Ubuntu and Windows?

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, eg 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.

On Mac OS X things should work fine with the built-in terminal as long as you have the encoding set in Preferences > Settings > Advanced and you've selected “Set locale environment variables on startup.” (These are the defaults.)

Apparently MSysGit on Windows doesn't support UTF-8, but if you pipe git command output through a copy of less from cygwin things will work. There's some useful info in the msysgit Google Group .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM