verbs2016
V2EX  ›  微软

git 上传 windows 项目,资源文件中的内容乱码

  •  
  •   verbs2016 · Nov 21, 2018 · 2767 views
    This topic created in 2759 days ago, the information mentioned may be changed or developed.

    用 vs2013 编写的 windows 程序,项目下有一个 resource.rc 的文件中有中文,上传到 git 仓库,checkout 出来时就会乱码,请问该如何解决?谢谢大神们啦(^_^)

    PS:

    1. git 版本:git version 2.15.1.windows.2
    2. 目前 git 的配置:可以提交中文信息,可以显示中文 Log。
    4 replies    2018-11-21 14:33:33 +08:00
    yidinghe
        2
    yidinghe  
       Nov 21, 2018
    另外检查一下文件编码,最好统一为 UTF-8 编码。
    verbs2016
        3
    verbs2016  
    OP
       Nov 21, 2018
    @yidinghe 这个地方设置过了.gitattributes 文件里面有设置的 >*.rc text eol=crlf
    git config --global 里也设置了 core.autocrlf=true
    文件编码,vs2013 好像都是 gbk 的编码
    verbs2016
        4
    verbs2016  
    OP
       Nov 21, 2018
    找到原因了:
    是因为添加的资源文件(.rc 和 .h)的字符编码与.cpp 的不同,不知道为什么会产生这种情况。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   948 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 129ms · UTC 20:02 · PVG 04:02 · LAX 13:02 · JFK 16:02
    ♥ Do have faith in what you're doing.