Document directory
- 1. Question about Chinese Input in gitbash
- 2. Question about the Chinese output of the page splitter.
- 3 LS command to display Chinese file name garbled
# Configuration of git Chinese support environment under Win
# Reference: git authoritative guide
After installing msysgit in Windows, you can't wait to open gitbash.
I typed a Chinese character. Why is there nothing?
Figure 1
Next, let's take a look at the method configuration in the GIT authoritative guide. Here, my git installation directory is D: \ devsofts \ git. The following operations are not particularly described in this directory.
You can use the text editor to modify the configuration file.
1. Question about Chinese Input in gitbash
The default msysgit shell cannot input Chinese characters.
The value to be modified is/etc/inputrc.
Original content:
# Disable/enable 8bit Input
Set meta-flag on
Set input-meta on
Set output-meta off
Set convert-meta on
To:
# Disable/enable 8bit Input
Set meta-flag on
Set input-meta on
Set output-meta on # first place
Set convert-meta off # second place
Save the modification, open gitbash again, and check the effect.
$ Hello
Figure 2
2. Question about the Chinese output of the page splitter.
When we perform the operation, there will still be garbled code $ echo ya'an | less
Figure 3
The modified file is also in the ECT directory,/etc/porfile
Add the following environment settings at the end of the file:
Declare-x lesscharset = UTF-8 # remember that there is no space after the = Sign
Incorrect syntax
Declare-x lesscharset = UTF-8
Figure 4
Show normal
3 LS command to display Chinese file name garbled
If the current directory contains Chinese characters, the file name will contain garbled characters when using ls to list objects.
Figure 5 shows the question mark
The simplest solution is to add a string of parameters after ls.
Figure 6
For the sake of convenience, we also configure it to/etc/porfile, and add it at the end.
The configuration is as follows:
Alias ls = "ls -- show-control-chars"
Figure 7. This is normal.
For other encoding problems, such as comment and commit, if you find a good way to record the file name.