summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2019-03-19 13:16:50 +0200
committerEli Zaretskii <eliz@gnu.org>2019-03-19 13:16:50 +0200
commit5ed05fbf62799bb55723860c3eb5141acecb26f6 (patch)
tree7f88d3991aad511f7a22cfa08ce596f550eff5f4
parente9f2d1f9f6bfd14d245bcbcbfa4a5222166c4dbb (diff)
downloademacs-5ed05fbf62799bb55723860c3eb5141acecb26f6.tar.gz
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
(member name package-unsigned-archives))
;; If we don't care about the signature, save the file and
;; we're done.
- (progn (write-region content nil local-file nil 'silent)
+ (progn (let ((coding-system-for-write 'utf-8))
+ (write-region content nil local-file nil 'silent))
(package--update-downloads-in-progress archive))
;; If we care, check it (perhaps async) and *then* write the file.
(package--check-signature
location file content async
;; This function will be called after signature checking.
(lambda (&optional good-sigs)
- (write-region content nil local-file nil 'silent)
+ (let ((coding-system-for-write 'utf-8))
+ (write-region content nil local-file nil 'silent))
;; Write out good signatures into archive-contents.signed file.
(when good-sigs
(write-region (mapconcat #'epg-signature-to-string good-sigs "\n")
@@ -3425,6 +3427,9 @@ short description."
;; Generate the Package Menu.
(let ((buf (get-buffer-create "*Packages*")))
(with-current-buffer buf
+ ;; Since some packages have their descriptions include non-ASCII
+ ;; characters...
+ (setq buffer-file-coding-system 'utf-8)
(package-menu-mode)
;; Fetch the remote list of packages.