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

后端 未结 6 1868
一向
一向 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 16:01

    You could maybe build something in python with the excellent chardet, then convert your files to UTF-8 and send this to GNU diff ?

    http://chardet.feedparser.org/

提交回复
热议问题