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

Re: Ascii/binary detection.

From: Charles Wilson <pathfinder_at_acm.org>
Date: 2001-08-01 17:46:55 CEST

>>1. Develop a heuristic for determining the binariness of a file, say
>> svn_io_is_binary_file ()
>>
>(Two suggestions: a) don't mark the file as binary just because
>there's a byte with value >= 128 in it; b) if other tests aren't
>conclusive, check for extremely long lines in the file?)

A good check for binary is a 0x00 (or 0x0000 depending on the
encoding) in the file.

>>`svn:line-ending'
>>
>> If this property is present on a given non-binary file, its value
>> is used to determine how line-endings should be translated.
>>
>> Values for this can be:
>>
>> 'native' - Use the line ending mechanism native
>> to the user's operating system.
>> 'dos', 'unix', or 'mac' - Use CRLF, LF, or LFCR, respectively.
>>
>I'm not sure what the correct 'mac' line ending is. Have to check that.

Macintosh <CR>
VMS <LF><CR>

It should be noted that due to historic screwups with implementations
of C development environments on the Macintosh, '\n' and '\r' aren't
always mapped correctly. It is necessary to define all of the
following sequences:

CHR_LF, CHR_CR, CHR_NL
STR_LF, STR_CR, STR_NL

You may also want to consider inclusion of an arbitrary byte sequence
for future use and too speed up development of new 'official' values.

-- 
- charles
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 21 14:36:34 2006

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.