-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 09/06/2011 11:33 AM, Remigiusz Modrzejewski wrote:
>
> On Sep 6, 2011, at 1:18 AM, Konstantin Khomoutov wrote:
>
>> The problem is while PDF is considered to be a binary file (and it
>> indeed usually contains compressed regions, it does contain ASCII header
>> and footer (I think it's its PostScript heritage), so it can be
>> considered to be a plain ASCII file by any tool which does not look for
>> its special magic character sequence (in the first line of the header).
>> Probably Fossil does not do that.
>
> That's a bit funny, because the pdf files contain a single \r\n ending not 
> within a compressed region. Converting that to \n doesn't seem to break 
> anything, but did I just kill a kitten?

Yes. PDF files contain "tables of contents" that point to byte offsets
within the file. Changing line endings like that removes a byte, which
shifts everything. Some readers *may*, if a ToC entry points to
something that doesn't look like what they expect, search about a bit to
find the header. Some might not. Such PDF files are unreliable!

> And the more important question: should we make fossil to treat all pdf files 
> to be binary?

Yes. They are binary files. The fact that they contain lots of ASCII
text is misleading - they can't be treated as text files.

ABS

- --
Alaric Snell-Pym
http://www.snell-pym.org.uk/alaric/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk5l96kACgkQRgz/WHNxCGpk/gCfcOkct8f1WdqYxbqnDtDTE1qB
Fp0An2IjFOw5Yz5UvvTv1zt8PlCX3CHx
=bIsi
-----END PGP SIGNATURE-----
_______________________________________________
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users

Reply via email to