verbs2016
V2EX  ›  微软

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

  •  
  •   verbs2016 · Nov 21, 2018 · 2759 views
    This topic created in 2754 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   ·   1007 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 18:49 · PVG 02:49 · LAX 11:49 · JFK 14:49
    ♥ Do have faith in what you're doing.