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

Re: text and binary files in SVN

From: Erik Huelsmann <ehuels_at_gmail.com>
Date: 2007-08-14 16:43:19 CEST

On 8/14/07, Vincent Lefevre <vincent+svn@vinc17.org> wrote:
> On 2007-08-14 16:25:10 +0200, Erik Huelsmann wrote:
> > There's an algorithm to estimate whether files are binary or texty:
> >
> > Check the first 1024 bytes to be within the 020-0x7F and 0x07-0x0D
> > regions. If more than 85% of the bytes fall in that region (and none
> > were 0x00), then the file is probably texty.
>
> I wonder if non-occidental users would agree with you.

They don't have to. This is what currently defines texty and we've had
had no complaints. It's based on what diff thinks what's texty.

> And what about UTF-16?

There's no support for wide characters in the built-in diff routine.
You can use external diff routines, or provide a patch to support
it...

> > So, if your files don't have that property, Subversion will consider
> > them binary, until you set a mime-type which makes it look texty
> > (starting with text/)
>
> One can have compressed XML files with text/xml mime-type. How does
> Subversion handle that?

As incorrectly as the mime-type. Clearly a compressed XML file isn't
text. More appropriate seems application/xml. Or even
application/x-gzip+xml.

> Also, for instance, is text/rtf more textual
> than application/x-sh as far as diff is concerned?

Yes, because it doesn't have a text/* mime-type.

Bye,

Erik.

> --
> Vincent Lefèvre <vincent_at_vinc17.org> - Web: <http://www.vinc17.org/>
> 100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
> Work: CR INRIA - computer arithmetic / Arenaire project (LIP, ENS-Lyon)
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: users-help@subversion.tigris.org
>
>
Received on Tue Aug 14 16:41:30 2007

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

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