GNU bug report logs - #30664
25.2; eww-download corrupts PDF files (and probably other binary files too)

Previous Next

Package: emacs;

Reported by: omar.antolin <at> gmail.com

Date: Thu, 1 Mar 2018 16:39:02 UTC

Severity: normal

Found in version 25.2

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Andreas Schwab <schwab <at> suse.de>
To: omar.antolin <at> gmail.com
Cc: 30664 <at> debbugs.gnu.org
Subject: bug#30664: 25.2; eww-download corrupts PDF files (and probably other binary files too)
Date: Thu, 01 Mar 2018 18:10:34 +0100
On Mär 01 2018, omar.antolin <at> gmail.com wrote:

> I tried using eww-download (bound to `d` in eww buffers) to download a
> PDF file. This produced, as expected a file in my downloads directory,
> but I could not open it in my PDF reader. I immediately suspected that
> Emacs had done some unwanted coding system translation on the PDF file.
>
> The variable `last-coding-system-used` was set to `raw-text-dos` (I'm
> using Emacs 25.2 on Windows 10), and the `dos` part sounded suspicious
> to me. Adding the item `("\\.pdf\\'" no-conversion . no-conversion)` to
> the variable `file-coding-system-alist` and redownloading the file fixed
> the problem and produced a valid PDF file.
>
> I'm not sure adding that entry to the default value of
> `file-coding-system-alist` is the right way to solve this problem
> though, because where does it stop? Would we add all known binary file
> types to the list with `no-conversion` specifications?

I think it's only a problem because PDF files look like text files.
Other binary files are immediately recognized as binary.

Andreas.

-- 
Andreas Schwab, SUSE Labs, schwab <at> suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."




This bug report was last modified 7 years and 169 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.