Git | 中文输出信息转码(乱码)

当我向Github 进行 pushpull 时,我的文件名为中文的文件会以 Ascii码 的形式输出,比如:

Git 中文输出信息转码

这些,其实并没有”乱码“,它只是以不直观的Ascii码的形式向我们输出,我们看不懂而已,比如我在Python中把它中间的一小段解一下码:

Python 3.6.7 (default, Oct 22 2018, 11:32:17)
[GCC 8.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> b'\350\265\204\346\272\220\347\275\221\345\235\200'.decode('utf-8')
'资源网址'
>>>

那么,问题是可以中文正常输出吗?
可以:

git config --global core.quotepath false
git config --global i18n.commit.encoding utf-8
git config --global i18n.logoutputencoding utf-8
export LESSCHARSET=utf-8

试验平台:Ubuntu, Manjaro

Tags: Git, Github, 中文输出, utf-8, Ascii, 乱码, decode

你可能感兴趣的:(Git | 中文输出信息转码(乱码))