[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: extending the blame callback

From: Daniel Shahaf <d.s_at_daniel.shahaf.name>
Date: Sun, 06 Jan 2019 18:54:43 +0000

Branko Čibej wrote on Sun, 06 Jan 2019 19:37 +0100:
> A simple check would be:
>
> * if 0x0a is on an odd offset, and the next byte is 0x00, then it's a
> UTF-16-LE linefeed;
> * else if 0x0a is on an even offset, and the _previous_ byte is 0x00,
> then it's a UTF-16-BE linefeed;

Would would happen if it were an ASCII/UTF-8 file that happened to
have a literal NUL byte next to an LF byte? I have seen/used
some of those.

> * otherwise just hope it's a linefeed and move on.

The encoding may also be set explicitly via a svn:mime-type="text/foo;
charset=utf-16-le" property. (We even parse that in mod_dav_svn, I think?)

Cheers,

Daniel
Received on 2019-01-06 19:54:59 CET

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.