From unknown Sat Sep 13 08:55:41 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#30664 <30664@debbugs.gnu.org> To: bug#30664 <30664@debbugs.gnu.org> Subject: Status: 25.2; eww-download corrupts PDF files (and probably other binary files too) Reply-To: bug#30664 <30664@debbugs.gnu.org> Date: Sat, 13 Sep 2025 15:55:41 +0000 retitle 30664 25.2; eww-download corrupts PDF files (and probably other bin= ary files too) reassign 30664 emacs submitter 30664 omar.antolin@gmail.com severity 30664 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Thu Mar 01 11:38:09 2018 Received: (at submit) by debbugs.gnu.org; 1 Mar 2018 16:38:09 +0000 Received: from localhost ([127.0.0.1]:39542 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1erRDb-00063W-Cj for submit@debbugs.gnu.org; Thu, 01 Mar 2018 11:38:08 -0500 Received: from eggs.gnu.org ([208.118.235.92]:39753) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1erQbm-0003Bh-7P for submit@debbugs.gnu.org; Thu, 01 Mar 2018 10:59:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1erQbc-0003CI-RM for submit@debbugs.gnu.org; Thu, 01 Mar 2018 10:58:56 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:58383) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1erQbc-0003CB-Mz for submit@debbugs.gnu.org; Thu, 01 Mar 2018 10:58:52 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58860) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1erQbW-0002w5-F0 for bug-gnu-emacs@gnu.org; Thu, 01 Mar 2018 10:58:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1erQbS-00032f-HS for bug-gnu-emacs@gnu.org; Thu, 01 Mar 2018 10:58:46 -0500 Received: from mail-qt0-x229.google.com ([2607:f8b0:400d:c0d::229]:44608) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1erQbS-00031a-Bf for bug-gnu-emacs@gnu.org; Thu, 01 Mar 2018 10:58:42 -0500 Received: by mail-qt0-x229.google.com with SMTP id g60so8101409qtd.11 for ; Thu, 01 Mar 2018 07:58:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version; bh=3N+JA8+VH/VCS3Mq5gEYmFc+m/nraqautc1ANTAkyhc=; b=dydnZ4r30oDRVaLAERgnkdTStsD5N2Gc0aYPmicz0bZDOp0NravfzUMMLIg1B8fYzX ZywbTon4/lDYocK8LxMHkzcF6F9I3ftwqv7ia/mNspP/kZ2SLTYlMZ+SnuRoOIIbQ2MQ T07DGY36LKMVdjwgJH2HODnrSH5LH3ZVB+RH7XOBPVSmsIrm5Nhf3ROLHRlHNXLrtr1E h9nvHlF0xiCughZBZG5S/4OqKm/Fjz/WD52t9TXG4s/jA1vN0t6Iyz9sRQhsM9wb5HfR 860c6PD+5aC+sRQfkeO8yTT/1l081G3yTt0IgQOzD76CKB/NJpfCnyx1HW6AXmhfHAtn 6PnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version; bh=3N+JA8+VH/VCS3Mq5gEYmFc+m/nraqautc1ANTAkyhc=; b=t/Smbb3u685VciJneE9pHdEKsJhvnIL0UrWg0z3tD808/wKCq03X9MWIJDeJqCbKF+ o6bv3nn1vEwWuZjRcD/XHZUOguy+BhBg3fYLhnOtSO7pGwjuYUf5kspgEFX/u1qOLIdQ y2Q0MrSe7OQ8f7/o0yCJZVG/eGP4ssWVfGYqhRnWE0OVPucCEnJIwe7V5QKAM7aMPUuX 4DkF+fxMtZf9cXdjR25N4fpynYKk5Xc+t5WRwRn2AOJFdcme4z/DV7q5xhkHKJyTPQpa on7JXtgHx0LAcRnI+Tng6WH8QhFjPHnJXoDtGG0XHX3LFgGy0L2g8kRtnjt8BuZtueWk VBSw== X-Gm-Message-State: AElRT7HhOhO/eSxHBByUbA6UbYE8ve2+k4VP0YGuIIoDzT4lv9zESt+P iDOUDewiAgCHJETA83GG54Mrstxn X-Google-Smtp-Source: AG47ELvwSbZ+bHKU9DZ7GkGV6qxKK8b1DFcy8HTOqvHWHaOmvjjbg70wqjeMKj9ry0sEHvDqioZvqQ== X-Received: by 10.200.1.83 with SMTP id f19mr3582485qtg.177.1519919920972; Thu, 01 Mar 2018 07:58:40 -0800 (PST) Received: from HP-Tablet ([132.248.64.81]) by smtp.gmail.com with ESMTPSA id o29sm3074877qtl.39.2018.03.01.07.58.39 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Mar 2018 07:58:39 -0800 (PST) From: omar.antolin@gmail.com To: bug-gnu-emacs@gnu.org Subject: 25.2; eww-download corrupts PDF files (and probably other binary files too) Date: Thu, 01 Mar 2018 09:58:30 -0600 Message-ID: <86muzrdbyx.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Thu, 01 Mar 2018 11:38:03 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) 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 might be best to modify the function `eww-download-callback` to save the downloaded file with no-conversion either always or in certain cases. Maybe the HTTP response can be inspected and if the type is not text/something to use no-conversion. In GNU Emacs 25.2.1 (i686-w64-mingw32) of 2017-04-24 built on LAPHROAIG Windowing system distributor 'Microsoft Corp.', version 10.0.16299 Configured using: 'configure --host=i686-w64-mingw32 --without-dbus --without-compress-install 'CFLAGS=-static -O2 -g3'' Configured features: XPM JPEG TIFF GIF PNG RSVG SOUND NOTIFY ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS Important settings: value of $LANG: ENU locale-coding-system: cp1252 Major mode: Lisp Interaction Minor modes in effect: recentf-mode: t rainbow-delimiters-mode: t which-key-mode: t smartparens-global-mode: t smartparens-mode: t ivy-mode: t global-gobble-whitespace-mode: t override-global-mode: t tooltip-mode: t global-eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Recent messages: Loading em-prompt...done Loading em-script...done Loading em-term...done Loading em-unix...done History item: 128 No matches History item: 128 Mark saved where search started Delete julia-0.6.1-win32.exe (y or n) y Deleting...done Quit Load-path shadows: c:/Users/oanto/.emacs.d/elpa/org-plus-contrib-20180226/ox hides c:/Users/oanto/Emacs-25.2/share/emacs/25.2/lisp/org/ox c:/Users/oanto/.emacs.d/elpa/org-plus-contrib-20180226/ox-texinfo hides c:/Users/oanto/Emacs-25.2/share/emacs/25.2/lisp/org/ox-texinfo c:/Users/oanto/.emacs.d/elpa/org-plus-contrib-20180226/ox-publish hides c:/Users/oanto/Emacs-25.2/share/emacs/25.2/lisp/org/ox-publish c:/Users/oanto/.emacs.d/elpa/org-plus-contrib-20180226/ox-org hides c:/Users/oanto/Emacs-25.2/share/emacs/25.2/lisp/org/ox-org c:/Users/oanto/.emacs.d/elpa/org-plus-contrib-20180226/ox-odt hides c:/Users/oanto/Emacs-25.2/share/emacs/25.2/lisp/org/ox-odt c:/Users/oanto/.emacs.d/elpa/org-plus-contrib-20180226/ox-md hides c:/Users/oanto/Emacs-25.2/share/emacs/25.2/lisp/org/ox-md c:/Users/oanto/.emacs.d/elpa/org-plus-contrib-20180226/ox-man hides c:/Users/oanto/Emacs-25.2/share/emacs/25.2/lisp/org/ox-man c:/Users/oanto/.emacs.d/elpa/org-plus-contrib-20180226/ox-latex hides c:/Users/oanto/Emacs-25.2/share/emacs/25.2/lisp/org/ox-latex c:/Users/oanto/.emacs.d/elpa/org-plus-contrib-20180226/ox-icalendar hides c:/Users/oanto/Emacs-25.2/share/emacs/25.2/lisp/org/ox-icalendar c:/Users/oanto/.emacs.d/elpa/org-plus-contrib-20180226/ox-html hides c:/Users/oanto/Emacs-25.2/share/emacs/25.2/lisp/org/ox-html c:/Users/oanto/.emacs.d/elpa/org-plus-contrib-20180226/ox-beamer hides c:/Users/oanto/Emacs-25.2/share/emacs/25.2/lisp/org/ox-beamer c:/Users/oanto/.emacs.d/elpa/org-plus-contrib-20180226/ox-ascii hides c:/Users/oanto/Emacs-25.2/share/emacs/25.2/lisp/org/ox-ascii c:/Users/oanto/.emacs.d/elpa/org-plus-contrib-20180226/org hides c:/Users/oanto/Emacs-25.2/share/emacs/25.2/lisp/org/org c:/Users/oanto/.emacs.d/elpa/org-plus-contrib-20180226/org-w3m hides c:/Users/oanto/Emacs-25.2/share/emacs/25.2/lisp/org/org-w3m c:/Users/oanto/.emacs.d/elpa/org-plus-contrib-20180226/org-version hides c:/Users/oanto/Emacs-25.2/share/emacs/25.2/lisp/org/org-version c:/Users/oanto/.emacs.d/elpa/org-plus-contrib-20180226/org-timer hides c:/Users/oanto/Emacs-25.2/share/emacs/25.2/lisp/org/org-timer c:/Users/oanto/.emacs.d/elpa/org-plus-contrib-20180226/org-table hides c:/Users/oanto/Emacs-25.2/share/emacs/25.2/lisp/org/org-table c:/Users/oanto/.emacs.d/elpa/org-plus-contrib-20180226/org-src hides c:/Users/oanto/Emacs-25.2/share/emacs/25.2/lisp/org/org-src c:/Users/oanto/.emacs.d/elpa/org-plus-contrib-20180226/org-rmail hides c:/Users/oanto/Emacs-25.2/share/emacs/25.2/lisp/org/org-rmail c:/Users/oanto/.emacs.d/elpa/org-plus-contrib-20180226/org-protocol hides c:/Users/oanto/Emacs-25.2/share/emacs/25.2/lisp/org/org-protocol c:/Users/oanto/.emacs.d/elpa/org-plus-contrib-20180226/org-plot hides c:/Users/oanto/Emacs-25.2/share/emacs/25.2/lisp/org/org-plot c:/Users/oanto/.emacs.d/elpa/org-plus-contrib-20180226/org-pcomplete hides c:/Users/oanto/Emacs-25.2/share/emacs/25.2/lisp/org/org-pcomplete c:/Users/oanto/.emacs.d/elpa/org-plus-contrib-20180226/org-mouse hides c:/Users/oanto/Emacs-25.2/share/emacs/25.2/lisp/org/org-mouse c:/Users/oanto/.emacs.d/elpa/org-plus-contrib-20180226/org-mobile hides c:/Users/oanto/Emacs-25.2/share/emacs/25.2/lisp/org/org-mobile c:/Users/oanto/.emacs.d/elpa/org-plus-contrib-20180226/org-mhe hides c:/Users/oanto/Emacs-25.2/share/emacs/25.2/lisp/org/org-mhe c:/Users/oanto/.emacs.d/elpa/org-plus-contrib-20180226/org-macs hides c:/Users/oanto/Emacs-25.2/share/emacs/25.2/lisp/org/org-macs c:/Users/oanto/.emacs.d/elpa/org-plus-contrib-20180226/org-macro hides c:/Users/oanto/Emacs-25.2/share/emacs/25.2/lisp/org/org-macro c:/Users/oanto/.emacs.d/elpa/org-plus-contrib-20180226/org-loaddefs hides c:/Users/oanto/Emacs-25.2/share/emacs/25.2/lisp/org/org-loaddefs c:/Users/oanto/.emacs.d/elpa/org-plus-contrib-20180226/org-list hides c:/Users/oanto/Emacs-25.2/share/emacs/25.2/lisp/org/org-list c:/Users/oanto/.emacs.d/elpa/org-plus-contrib-20180226/org-irc hides c:/Users/oanto/Emacs-25.2/share/emacs/25.2/lisp/org/org-irc c:/Users/oanto/.emacs.d/elpa/org-plus-contrib-20180226/org-install hides c:/Users/oanto/Emacs-25.2/share/emacs/25.2/lisp/org/org-install c:/Users/oanto/.emacs.d/elpa/org-plus-contrib-20180226/org-inlinetask hides c:/Users/oanto/Emacs-25.2/share/emacs/25.2/lisp/org/org-inlinetask c:/Users/oanto/.emacs.d/elpa/org-plus-contrib-20180226/org-info hides c:/Users/oanto/Emacs-25.2/share/emacs/25.2/lisp/org/org-info c:/Users/oanto/.emacs.d/elpa/org-plus-contrib-20180226/org-indent hides c:/Users/oanto/Emacs-25.2/share/emacs/25.2/lisp/org/org-indent c:/Users/oanto/.emacs.d/elpa/org-plus-contrib-20180226/org-id hides c:/Users/oanto/Emacs-25.2/share/emacs/25.2/lisp/org/org-id c:/Users/oanto/.emacs.d/elpa/org-plus-contrib-20180226/org-habit hides c:/Users/oanto/Emacs-25.2/share/emacs/25.2/lisp/org/org-habit c:/Users/oanto/.emacs.d/elpa/org-plus-contrib-20180226/org-gnus hides c:/Users/oanto/Emacs-25.2/share/emacs/25.2/lisp/org/org-gnus c:/Users/oanto/.emacs.d/elpa/org-plus-contrib-20180226/org-footnote hides c:/Users/oanto/Emacs-25.2/share/emacs/25.2/lisp/org/org-footnote c:/Users/oanto/.emacs.d/elpa/org-plus-contrib-20180226/org-feed hides c:/Users/oanto/Emacs-25.2/share/emacs/25.2/lisp/org/org-feed c:/Users/oanto/.emacs.d/elpa/org-plus-contrib-20180226/org-faces hides c:/Users/oanto/Emacs-25.2/share/emacs/25.2/lisp/org/org-faces c:/Users/oanto/.emacs.d/elpa/org-plus-contrib-20180226/org-eshell hides c:/Users/oanto/Emacs-25.2/share/emacs/25.2/lisp/org/org-eshell c:/Users/oanto/.emacs.d/elpa/org-plus-contrib-20180226/org-entities hides c:/Users/oanto/Emacs-25.2/share/emacs/25.2/lisp/org/org-entities c:/Users/oanto/.emacs.d/elpa/org-plus-contrib-20180226/org-element hides c:/Users/oanto/Emacs-25.2/share/emacs/25.2/lisp/org/org-element c:/Users/oanto/.emacs.d/elpa/org-plus-contrib-20180226/org-docview hides c:/Users/oanto/Emacs-25.2/share/emacs/25.2/lisp/org/org-docview c:/Users/oanto/.emacs.d/elpa/org-plus-contrib-20180226/org-datetree hides c:/Users/oanto/Emacs-25.2/share/emacs/25.2/lisp/org/org-datetree c:/Users/oanto/.emacs.d/elpa/org-plus-contrib-20180226/org-ctags hides c:/Users/oanto/Emacs-25.2/share/emacs/25.2/lisp/org/org-ctags c:/Users/oanto/.emacs.d/elpa/org-plus-contrib-20180226/org-crypt hides c:/Users/oanto/Emacs-25.2/share/emacs/25.2/lisp/org/org-crypt c:/Users/oanto/.emacs.d/elpa/org-plus-contrib-20180226/org-compat hides c:/Users/oanto/Emacs-25.2/share/emacs/25.2/lisp/org/org-compat c:/Users/oanto/.emacs.d/elpa/org-plus-contrib-20180226/org-colview hides c:/Users/oanto/Emacs-25.2/share/emacs/25.2/lisp/org/org-colview c:/Users/oanto/.emacs.d/elpa/org-plus-contrib-20180226/org-clock hides c:/Users/oanto/Emacs-25.2/share/emacs/25.2/lisp/org/org-clock c:/Users/oanto/.emacs.d/elpa/org-plus-contrib-20180226/org-capture hides c:/Users/oanto/Emacs-25.2/share/emacs/25.2/lisp/org/org-capture c:/Users/oanto/.emacs.d/elpa/org-plus-contrib-20180226/org-bibtex hides c:/Users/oanto/Emacs-25.2/share/emacs/25.2/lisp/org/org-bibtex c:/Users/oanto/.emacs.d/elpa/org-plus-contrib-20180226/org-bbdb hides c:/Users/oanto/Emacs-25.2/share/emacs/25.2/lisp/org/org-bbdb c:/Users/oanto/.emacs.d/elpa/org-plus-contrib-20180226/org-attach hides c:/Users/oanto/Emacs-25.2/share/emacs/25.2/lisp/org/org-attach c:/Users/oanto/.emacs.d/elpa/org-plus-contrib-20180226/org-archive hides c:/Users/oanto/Emacs-25.2/share/emacs/25.2/lisp/org/org-archive c:/Users/oanto/.emacs.d/elpa/org-plus-contrib-20180226/org-agenda hides c:/Users/oanto/Emacs-25.2/share/emacs/25.2/lisp/org/org-agenda c:/Users/oanto/.emacs.d/elpa/org-plus-contrib-20180226/ob hides c:/Users/oanto/Emacs-25.2/share/emacs/25.2/lisp/org/ob c:/Users/oanto/.emacs.d/elpa/org-plus-contrib-20180226/ob-tangle hides c:/Users/oanto/Emacs-25.2/share/emacs/25.2/lisp/org/ob-tangle c:/Users/oanto/.emacs.d/elpa/org-plus-contrib-20180226/ob-table hides c:/Users/oanto/Emacs-25.2/share/emacs/25.2/lisp/org/ob-table c:/Users/oanto/.emacs.d/elpa/org-plus-contrib-20180226/ob-sqlite hides c:/Users/oanto/Emacs-25.2/share/emacs/25.2/lisp/org/ob-sqlite c:/Users/oanto/.emacs.d/elpa/org-plus-contrib-20180226/ob-sql hides c:/Users/oanto/Emacs-25.2/share/emacs/25.2/lisp/org/ob-sql c:/Users/oanto/.emacs.d/elpa/org-plus-contrib-20180226/ob-shen hides c:/Users/oanto/Emacs-25.2/share/emacs/25.2/lisp/org/ob-shen c:/Users/oanto/.emacs.d/elpa/org-plus-contrib-20180226/ob-screen hides c:/Users/oanto/Emacs-25.2/share/emacs/25.2/lisp/org/ob-screen c:/Users/oanto/.emacs.d/elpa/org-plus-contrib-20180226/ob-scheme hides c:/Users/oanto/Emacs-25.2/share/emacs/25.2/lisp/org/ob-scheme c:/Users/oanto/.emacs.d/elpa/org-plus-contrib-20180226/ob-sass hides c:/Users/oanto/Emacs-25.2/share/emacs/25.2/lisp/org/ob-sass c:/Users/oanto/.emacs.d/elpa/org-plus-contrib-20180226/ob-ruby hides c:/Users/oanto/Emacs-25.2/share/emacs/25.2/lisp/org/ob-ruby c:/Users/oanto/.emacs.d/elpa/org-plus-contrib-20180226/ob-ref hides c:/Users/oanto/Emacs-25.2/share/emacs/25.2/lisp/org/ob-ref c:/Users/oanto/.emacs.d/elpa/org-plus-contrib-20180226/ob-R hides c:/Users/oanto/Emacs-25.2/share/emacs/25.2/lisp/org/ob-R c:/Users/oanto/.emacs.d/elpa/org-plus-contrib-20180226/ob-python hides c:/Users/oanto/Emacs-25.2/share/emacs/25.2/lisp/org/ob-python c:/Users/oanto/.emacs.d/elpa/org-plus-contrib-20180226/ob-plantuml hides c:/Users/oanto/Emacs-25.2/share/emacs/25.2/lisp/org/ob-plantuml c:/Users/oanto/.emacs.d/elpa/org-plus-contrib-20180226/ob-picolisp hides c:/Users/oanto/Emacs-25.2/share/emacs/25.2/lisp/org/ob-picolisp c:/Users/oanto/.emacs.d/elpa/org-plus-contrib-20180226/ob-perl hides c:/Users/oanto/Emacs-25.2/share/emacs/25.2/lisp/org/ob-perl c:/Users/oanto/.emacs.d/elpa/org-plus-contrib-20180226/ob-org hides c:/Users/oanto/Emacs-25.2/share/emacs/25.2/lisp/org/ob-org c:/Users/oanto/.emacs.d/elpa/org-plus-contrib-20180226/ob-octave hides c:/Users/oanto/Emacs-25.2/share/emacs/25.2/lisp/org/ob-octave c:/Users/oanto/.emacs.d/elpa/org-plus-contrib-20180226/ob-ocaml hides c:/Users/oanto/Emacs-25.2/share/emacs/25.2/lisp/org/ob-ocaml c:/Users/oanto/.emacs.d/elpa/org-plus-contrib-20180226/ob-mscgen hides c:/Users/oanto/Emacs-25.2/share/emacs/25.2/lisp/org/ob-mscgen c:/Users/oanto/.emacs.d/elpa/org-plus-contrib-20180226/ob-maxima hides c:/Users/oanto/Emacs-25.2/share/emacs/25.2/lisp/org/ob-maxima c:/Users/oanto/.emacs.d/elpa/org-plus-contrib-20180226/ob-matlab hides c:/Users/oanto/Emacs-25.2/share/emacs/25.2/lisp/org/ob-matlab c:/Users/oanto/.emacs.d/elpa/org-plus-contrib-20180226/ob-makefile hides c:/Users/oanto/Emacs-25.2/share/emacs/25.2/lisp/org/ob-makefile c:/Users/oanto/.emacs.d/elpa/org-plus-contrib-20180226/ob-lob hides c:/Users/oanto/Emacs-25.2/share/emacs/25.2/lisp/org/ob-lob c:/Users/oanto/.emacs.d/elpa/org-plus-contrib-20180226/ob-lisp hides c:/Users/oanto/Emacs-25.2/share/emacs/25.2/lisp/org/ob-lisp c:/Users/oanto/.emacs.d/elpa/org-plus-contrib-20180226/ob-lilypond hides c:/Users/oanto/Emacs-25.2/share/emacs/25.2/lisp/org/ob-lilypond c:/Users/oanto/.emacs.d/elpa/org-plus-contrib-20180226/ob-ledger hides c:/Users/oanto/Emacs-25.2/share/emacs/25.2/lisp/org/ob-ledger c:/Users/oanto/.emacs.d/elpa/org-plus-contrib-20180226/ob-latex hides c:/Users/oanto/Emacs-25.2/share/emacs/25.2/lisp/org/ob-latex c:/Users/oanto/.emacs.d/elpa/org-plus-contrib-20180226/ob-keys hides c:/Users/oanto/Emacs-25.2/share/emacs/25.2/lisp/org/ob-keys c:/Users/oanto/.emacs.d/elpa/org-plus-contrib-20180226/ob-js hides c:/Users/oanto/Emacs-25.2/share/emacs/25.2/lisp/org/ob-js c:/Users/oanto/.emacs.d/elpa/org-plus-contrib-20180226/ob-java hides c:/Users/oanto/Emacs-25.2/share/emacs/25.2/lisp/org/ob-java c:/Users/oanto/.emacs.d/elpa/org-plus-contrib-20180226/ob-io hides c:/Users/oanto/Emacs-25.2/share/emacs/25.2/lisp/org/ob-io c:/Users/oanto/.emacs.d/elpa/org-plus-contrib-20180226/ob-haskell hides c:/Users/oanto/Emacs-25.2/share/emacs/25.2/lisp/org/ob-haskell c:/Users/oanto/.emacs.d/elpa/org-plus-contrib-20180226/ob-gnuplot hides c:/Users/oanto/Emacs-25.2/share/emacs/25.2/lisp/org/ob-gnuplot c:/Users/oanto/.emacs.d/elpa/org-plus-contrib-20180226/ob-fortran hides c:/Users/oanto/Emacs-25.2/share/emacs/25.2/lisp/org/ob-fortran c:/Users/oanto/.emacs.d/elpa/org-plus-contrib-20180226/ob-exp hides c:/Users/oanto/Emacs-25.2/share/emacs/25.2/lisp/org/ob-exp c:/Users/oanto/.emacs.d/elpa/org-plus-contrib-20180226/ob-eval hides c:/Users/oanto/Emacs-25.2/share/emacs/25.2/lisp/org/ob-eval c:/Users/oanto/.emacs.d/elpa/org-plus-contrib-20180226/ob-emacs-lisp hides c:/Users/oanto/Emacs-25.2/share/emacs/25.2/lisp/org/ob-emacs-lisp c:/Users/oanto/.emacs.d/elpa/org-plus-contrib-20180226/ob-dot hides c:/Users/oanto/Emacs-25.2/share/emacs/25.2/lisp/org/ob-dot c:/Users/oanto/.emacs.d/elpa/org-plus-contrib-20180226/ob-ditaa hides c:/Users/oanto/Emacs-25.2/share/emacs/25.2/lisp/org/ob-ditaa c:/Users/oanto/.emacs.d/elpa/org-plus-contrib-20180226/ob-css hides c:/Users/oanto/Emacs-25.2/share/emacs/25.2/lisp/org/ob-css c:/Users/oanto/.emacs.d/elpa/org-plus-contrib-20180226/ob-core hides c:/Users/oanto/Emacs-25.2/share/emacs/25.2/lisp/org/ob-core c:/Users/oanto/.emacs.d/elpa/org-plus-contrib-20180226/ob-comint hides c:/Users/oanto/Emacs-25.2/share/emacs/25.2/lisp/org/ob-comint c:/Users/oanto/.emacs.d/elpa/org-plus-contrib-20180226/ob-clojure hides c:/Users/oanto/Emacs-25.2/share/emacs/25.2/lisp/org/ob-clojure c:/Users/oanto/.emacs.d/elpa/org-plus-contrib-20180226/ob-calc hides c:/Users/oanto/Emacs-25.2/share/emacs/25.2/lisp/org/ob-calc c:/Users/oanto/.emacs.d/elpa/org-plus-contrib-20180226/ob-C hides c:/Users/oanto/Emacs-25.2/share/emacs/25.2/lisp/org/ob-C c:/Users/oanto/.emacs.d/elpa/org-plus-contrib-20180226/ob-awk hides c:/Users/oanto/Emacs-25.2/share/emacs/25.2/lisp/org/ob-awk c:/Users/oanto/.emacs.d/elpa/org-plus-contrib-20180226/ob-asymptote hides c:/Users/oanto/Emacs-25.2/share/emacs/25.2/lisp/org/ob-asymptote Features: (shadow sort bbdb-message mail-extr emacsbug message idna rfc822 mml mml-sec epg mm-decode mm-bodies mm-encode gmm-utils mailheader sendmail pcmpl-unix em-unix em-term term ehelp em-script em-prompt em-ls em-hist em-pred em-glob em-dirs em-cmpl em-basic em-banner em-alias pcomplete esh-var esh-io esh-cmd esh-opt esh-ext esh-proc esh-arg esh-groups eshell esh-module esh-mode dired-aux wdired macros mc-prompt-once multiple-cursors mc-hide-unmatched-lines-mode mc-separate-operations rectangular-region-mode mc-mark-pop mc-mark-more mc-cycle-cursors mc-edit-lines multiple-cursors-core rect dabbrev misc-text executable two-column iso-transl ace-window eieio-opt speedbar sb-image ezimage dframe find-func doc-view jka-compr image-mode parse-time recentf tree-widget bookmark pp network-stream nsm starttls url-http tls gnutls mail-parse rfc2231 rfc2047 rfc2045 ietf-drums url-gw url-cache url-auth eww mm-url bbdb-mua bbdb-com crm mailabbrev bbdb bbdb-site timezone gnus gnus-ems nnheader mail-utils url-queue url url-proxy url-privacy url-expand url-methods url-history url-cookie url-domsuf url-util mailcap shr dom subr-x browse-url format-spec colir color smex ido counsel dired compile comint ansi-color esh-util etags xref project swiper rainbow-delimiters which-key smartparens-config smartparens advice dash cus-edit cus-start cus-load wid-edit ivy-hydra ivy delsel ivy-overlay ffap thingatpt url-parse auth-source eieio eieio-core gnus-util mm-util help-fns mail-prsvr password-cache url-vars ace-link avy hydra ring lv gobble-whitespace edmacro kmacro diminish cl-macs cl-seq use-package use-package-ensure use-package-delight use-package-diminish use-package-bind-key bind-key easy-mmode use-package-core finder-inf tex-site slime-autoloads info package epg-config seq byte-opt gv bytecomp byte-compile cl-extra help-mode easymenu cconv cl-loaddefs pcase cl-lib time-date mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel dos-w32 ls-lisp disp-table w32-win w32-vars term/common-win tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment elisp-mode lisp-mode prog-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese charscript case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer cl-preloaded nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote w32notify w32 multi-tty make-network-process emacs) Memory information: ((conses 8 346633 45907) (symbols 32 39136 0) (miscs 32 154 602) (strings 16 91623 67578) (string-bytes 1 2621517) (vectors 8 42157) (vector-slots 4 1449017 44142) (floats 8 541 810) (intervals 28 531 1239) (buffers 520 48)) From debbugs-submit-bounces@debbugs.gnu.org Thu Mar 01 12:10:39 2018 Received: (at 30664) by debbugs.gnu.org; 1 Mar 2018 17:10:39 +0000 Received: from localhost ([127.0.0.1]:39567 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1erRj4-0006t9-K9 for submit@debbugs.gnu.org; Thu, 01 Mar 2018 12:10:38 -0500 Received: from mx2.suse.de ([195.135.220.15]:52746) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1erRj2-0006sz-AN for 30664@debbugs.gnu.org; Thu, 01 Mar 2018 12:10:36 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 4C88CAD64; Thu, 1 Mar 2018 17:10:35 +0000 (UTC) From: Andreas Schwab To: omar.antolin@gmail.com Subject: Re: bug#30664: 25.2; eww-download corrupts PDF files (and probably other binary files too) References: <86muzrdbyx.fsf@gmail.com> X-Yow: .. bleakness.... desolation.... plastic forks... Date: Thu, 01 Mar 2018 18:10:34 +0100 In-Reply-To: <86muzrdbyx.fsf@gmail.com> (omar antolin's message of "Thu, 01 Mar 2018 09:58:30 -0600") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.91 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 30664 Cc: 30664@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) On Mär 01 2018, omar.antolin@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@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different." From debbugs-submit-bounces@debbugs.gnu.org Thu Mar 01 14:17:07 2018 Received: (at 30664) by debbugs.gnu.org; 1 Mar 2018 19:17:07 +0000 Received: from localhost ([127.0.0.1]:39710 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1erThS-0003U5-Nv for submit@debbugs.gnu.org; Thu, 01 Mar 2018 14:17:06 -0500 Received: from eggs.gnu.org ([208.118.235.92]:37646) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1erThR-0003TW-9u for 30664@debbugs.gnu.org; Thu, 01 Mar 2018 14:17:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1erThI-0003hd-I7 for 30664@debbugs.gnu.org; Thu, 01 Mar 2018 14:17:00 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:59555) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1erThI-0003hV-Dy; Thu, 01 Mar 2018 14:16:56 -0500 Received: from [176.228.60.248] (port=4834 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1erThH-0003H1-Sf; Thu, 01 Mar 2018 14:16:56 -0500 Date: Thu, 01 Mar 2018 21:17:08 +0200 Message-Id: <834llzy5aj.fsf@gnu.org> From: Eli Zaretskii To: omar.antolin@gmail.com In-reply-to: <86muzrdbyx.fsf@gmail.com> (omar.antolin@gmail.com) Subject: Re: bug#30664: 25.2; eww-download corrupts PDF files (and probably other binary files too) References: <86muzrdbyx.fsf@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 30664 Cc: 30664@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > From: omar.antolin@gmail.com > Date: Thu, 01 Mar 2018 09:58:30 -0600 > > > 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. Does the patch below fix the problem? diff --git a/lisp/net/eww.el b/lisp/net/eww.el index caac96a..66b1767 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el @@ -1532,7 +1532,8 @@ eww-download-callback eww-download-directory))) (goto-char (point-min)) (re-search-forward "\r?\n\r?\n") - (write-region (point) (point-max) file) + (let ((coding-system-for-write 'no-conversion)) + (write-region (point) (point-max) file)) (message "Saved %s" file)))) (defun eww-decode-url-file-name (string) From debbugs-submit-bounces@debbugs.gnu.org Thu Mar 01 14:18:56 2018 Received: (at 30664) by debbugs.gnu.org; 1 Mar 2018 19:18:56 +0000 Received: from localhost ([127.0.0.1]:39714 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1erTjE-0003Wb-6o for submit@debbugs.gnu.org; Thu, 01 Mar 2018 14:18:56 -0500 Received: from eggs.gnu.org ([208.118.235.92]:38212) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1erTjC-0003WP-Dw for 30664@debbugs.gnu.org; Thu, 01 Mar 2018 14:18:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1erTj3-0004ea-Tc for 30664@debbugs.gnu.org; Thu, 01 Mar 2018 14:18:49 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:59588) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1erTj3-0004eM-PG; Thu, 01 Mar 2018 14:18:45 -0500 Received: from [176.228.60.248] (port=4836 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1erTj3-0003P6-6v; Thu, 01 Mar 2018 14:18:45 -0500 Date: Thu, 01 Mar 2018 21:18:56 +0200 Message-Id: <83371jy57j.fsf@gnu.org> From: Eli Zaretskii To: Andreas Schwab In-reply-to: (message from Andreas Schwab on Thu, 01 Mar 2018 18:10:34 +0100) Subject: Re: bug#30664: 25.2; eww-download corrupts PDF files (and probably other binary files too) References: <86muzrdbyx.fsf@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 30664 Cc: 30664@debbugs.gnu.org, omar.antolin@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > From: Andreas Schwab > Date: Thu, 01 Mar 2018 18:10:34 +0100 > Cc: 30664@debbugs.gnu.org > > I think it's only a problem because PDF files look like text files. > Other binary files are immediately recognized as binary. You are right, but I think a download function should produce a file that is identical to its original, even if it's a text file. No coding conversions or EOL conversions should take place. From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 02 03:46:07 2018 Received: (at 30664-done) by debbugs.gnu.org; 2 Mar 2018 08:46:07 +0000 Received: from localhost ([127.0.0.1]:40057 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ergKM-0006UK-EY for submit@debbugs.gnu.org; Fri, 02 Mar 2018 03:46:07 -0500 Received: from eggs.gnu.org ([208.118.235.92]:50270) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ergKK-0006TW-Qq for 30664-done@debbugs.gnu.org; Fri, 02 Mar 2018 03:46:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ergKA-00081S-OC for 30664-done@debbugs.gnu.org; Fri, 02 Mar 2018 03:45:59 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:41792) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ergKA-00081K-Jz; Fri, 02 Mar 2018 03:45:54 -0500 Received: from [176.228.60.248] (port=1527 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1ergK9-0006An-D6; Fri, 02 Mar 2018 03:45:54 -0500 Date: Fri, 02 Mar 2018 10:46:05 +0200 Message-Id: <83r2p2x3ua.fsf@gnu.org> From: Eli Zaretskii To: Omar =?utf-8?Q?Antol=C3=ADn?= Camarena In-reply-to: (message from Omar =?utf-8?Q?Antol=C3=ADn?= Camarena on Thu, 1 Mar 2018 15:24:27 -0600) Subject: Re: bug#30664: 25.2; eww-download corrupts PDF files (and probably other binary files too) References: <86muzrdbyx.fsf@gmail.com> <834llzy5aj.fsf@gnu.org> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 30664-done Cc: 30664-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > From: Omar Antolín Camarena > Date: Thu, 1 Mar 2018 15:24:27 -0600 > > I tested it and yes, that patch does fix the problem for me. Thanks, I installed that on the emacs-26 branch, and I'm closing the bug report. From unknown Sat Sep 13 08:55:41 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 30 Mar 2018 11:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator