On Mon, Feb 26, 2018 at 06:27:06PM +0100, tbo...@web.de wrote:
> @@ -3611,8 +3615,25 @@ int diff_populate_filespec(struct diff_filespec *s,
> unsigned int flags)
> s->size = size;
> s->should_free = 1;
> }
> - }
> - else {
> +
tbo...@web.de:
+static inline int buffer_has_utf16_bom(const void *buf, size_t len) {
+ const unsigned char *text = (unsigned char *)buf;
+ if (!text || len < 2)
+return 0;
+ if (text[0] == 0xff && text[1] == 0xfe)
+return 1;
+ if (text[0] == 0xfe && text[1] == 0xff)
+return 1;
From: Torsten Bögershausen
When an UTF-16 file is commited and later changed, `git diff` shows
"Binary files XX and YY differ".
When the user wants a diff in UTF-8, a textconv needs to be specified
in .gitattributes and the textconv must be configured.
A more user-friendly diff can be produced
3 matches
Mail list logo