designetwork(EN)

IT technical memo of networking

How to deal with garbled characters where Japanese is displayed in \xx in Git Bash

When using widely used version management tool Git on Windows, use Git for Windows (Git Bash).

When handling Japanese files, describe the correspondence between garbled characters that are displayed as \xx (backslash, \mark number).

Installation procedure of Git for Windows (Git Bash)

Please refer here for the download and installation procedure.

git-for-windows.github.io

What to do when Japanese is displayed with \xx (\digit)

By default, Git Bash makes Japanese files look garbled. However, it is not merely a garbled character, and Japanese is displayed as \xx (backslash digit) respectively.

Such a Japanese folder,

this is displayed.

In this case, it is necessary to change the locale and font setting of Git Bash as the initial setting. Click the icon in the upper left corner of the window or right click on the screen and select Options.

Since it is empty like this by default, select ja_JP.

Also select MS Gothic from Font> Select.

Finally, this state is reached. Character set select UTF-8, SJIS as appropriate.

Restart Git Bash

Here Restart (close and open) Git Bash.

This makes it possible to display Japanese without garbling.

Conclusion - How to deal Japanese in Git Bash

When Git Bash is in the initial state, the Japanese file/folder is displayed as \xx (backslash digit). By setting Locale and Font and restarting Git Bash, Japanese can be normally displayed.


This Blog is English Version of my JP's.

Sorry if my English sentences are incorrect.

designetwork