How do I diff utf-16 files with GNU diff?

后端 未结 6 1866
一向
一向 2021-01-01 15:07

GNU diff doesn\'t seem to be smart enough to detect and handle UTF-16 files, which surprises me. Am I missing an obvious command-line option? Is there a good alternative?<

6条回答
  •  無奈伤痛
    2021-01-01 15:56

    Malforms patches when accent marks or special characters are used:

     diff --version
     diff (GNU diffutils) 3.6
     diff -Naur old_foo new_foo > foo.patch
    

    Correctly handles accent marks or special characters regardless of whether compared files/dirs are in a git folder.

     git --version
     git version 2.17.1
     git diff --no-index old_foo new_foo > foo.patch
    

提交回复
热议问题