aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2019-03-19 13:16:50 +0200
committerEli Zaretskii2019-03-19 13:16:50 +0200
commit5ed05fbf62799bb55723860c3eb5141acecb26f6 (patch)
tree7f88d3991aad511f7a22cfa08ce596f550eff5f4
parente9f2d1f9f6bfd14d245bcbcbfa4a5222166c4dbb (diff)
downloademacs-5ed05fbf62799bb55723860c3eb5141acecb26f6.tar.gz
emacs-5ed05fbf62799bb55723860c3eb5141acecb26f6.zip
Fix downloading updates for packages with non-ASCII descriptions
* lisp/emacs-lisp/package.el (package--download-one-archive): Make sure archive contents are written using UTF-8 encoding. (Bug#34909) (list-packages): Set buffer's encoding to UTF-8.
-rw-r--r--lisp/emacs-lisp/package.el9
1 files changed, 7 insertions, 2 deletions
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
index 3118e38fcdd..1a185de4a52 100644
--- a/lisp/emacs-lisp/package.el
+++ b/lisp/emacs-lisp/package.el
@@ -1538,14 +1538,16 @@ similar to an entry in `package-alist'. Save the cached copy to
1538 (member name package-unsigned-archives)) 1538 (member name package-unsigned-archives))
1539 ;; If we don't care about the signature, save the file and 1539 ;; If we don't care about the signature, save the file and
1540 ;; we're done. 1540 ;; we're done.
1541 (progn (write-region content nil local-file nil 'silent) 1541 (progn (let ((coding-system-for-write 'utf-8))
1542 (write-region content nil local-file nil 'silent))
1542 (package--update-downloads-in-progress archive)) 1543 (package--update-downloads-in-progress archive))
1543 ;; If we care, check it (perhaps async) and *then* write the file. 1544 ;; If we care, check it (perhaps async) and *then* write the file.
1544 (package--check-signature 1545 (package--check-signature
1545 location file content async 1546 location file content async
1546 ;; This function will be called after signature checking. 1547 ;; This function will be called after signature checking.
1547 (lambda (&optional good-sigs) 1548 (lambda (&optional good-sigs)
1548 (write-region content nil local-file nil 'silent) 1549 (let ((coding-system-for-write 'utf-8))
1550 (write-region content nil local-file nil 'silent))
1549 ;; Write out good signatures into archive-contents.signed file. 1551 ;; Write out good signatures into archive-contents.signed file.
1550 (when good-sigs 1552 (when good-sigs
1551 (write-region (mapconcat #'epg-signature-to-string good-sigs "\n") 1553 (write-region (mapconcat #'epg-signature-to-string good-sigs "\n")
@@ -3425,6 +3427,9 @@ short description."
3425 ;; Generate the Package Menu. 3427 ;; Generate the Package Menu.
3426 (let ((buf (get-buffer-create "*Packages*"))) 3428 (let ((buf (get-buffer-create "*Packages*")))
3427 (with-current-buffer buf 3429 (with-current-buffer buf
3430 ;; Since some packages have their descriptions include non-ASCII
3431 ;; characters...
3432 (setq buffer-file-coding-system 'utf-8)
3428 (package-menu-mode) 3433 (package-menu-mode)
3429 3434
3430 ;; Fetch the remote list of packages. 3435 ;; Fetch the remote list of packages.