Re: Feature request: number of added and deleted lines for UTF-16 files
- From
- Александр Третьяк <alextretyak2@gmail.com>
- Date
- Mar 8, 2020, 21:37 UTC
- Message-ID
- <CACDhn-R6ZKvgMxJdxP7NpsAViY97PfC7aM8xTJgaQK_GLJRyvQ@mail.gmail.com>
- In-Reply-To
- <CACDhn-QHqGFhZw+3K61v+Qtmm5y35nARWJaBkZ_YyZevJu8HBQ@mail.gmail.com>
Some source files in MSVC (e.g. resource.h) are encoded in UTF-16 (LE) with Byte Order Mark (i.e. signature: FF FE for little-endian and FE FF for big-endian), and `git diff --numstat` shows `-` in place of number of added/removed lines, e.g.: - - clientapp/resource.h
Can you auto detect UTF-16 by reading first 2 bytes of the file, and correctly show number of lines added/removed?