【问题标题】:why does git show unicode as binary?为什么git将unicode显示为二进制?
【发布时间】:2015-10-13 15:16:45
【问题描述】:

为什么git status 和相关工具将文件名中的 unicode 视为二进制?

[991]anarcat@marcos:test$ git init foo
Dépôt Git vide initialisé dans /home/anarcat/test/foo/.git/
[992]anarcat@marcos:test$ cd foo
[993]anarcat@marcos:foo$ touch hé
[994]anarcat@marcos:foo$ git add hé
[996]anarcat@marcos:foo$ git status --porcelain
A  "h\303\251"

我希望这是:

A hé

git在文件的内容中处理重音和unicode很好,为什么文件名特别?

【问题讨论】:

    标签: git unicode internationalization


    【解决方案1】:

    默认情况下,git 以带引号的八进制表示法打印非 ascii 文件名。您可以禁用此功能

    git config --global core.quotepath off
    

    【讨论】:

    • 这正是我想要的,谢谢 René! :) 我希望这是默认设置...至少 git 应该尊重我的语言环境...
    猜你喜欢
    • 2012-03-31
    • 1970-01-01
    • 2011-10-14
    • 1970-01-01
    • 2020-08-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多