]> git.eshelyaron.com Git - emacs.git/commitdiff
Assume package archive-contents are UTF8-encoded
authorSteve Purcell <steve@sanityinc.com>
Sun, 19 Apr 2015 16:47:02 +0000 (17:47 +0100)
committerArtur Malabarba <bruce.connor.am@gmail.com>
Sun, 19 Apr 2015 16:56:46 +0000 (17:56 +0100)
* lisp/emacs-lisp/package.el (package--read-archive-file):
Set `coding-system-for-read' explicitly to 'utf-8 when reading the
downloaded and cached archive-contents files, so that non-ASCII
characters in package descriptions are displayed correctly in the
`list-packages' menu. (Bug#20231)

Co-authored-by: Steve Purcell <steve@sanityinc.com>
lisp/emacs-lisp/package.el

index 2fb54f0d944ba7f78bd8d7ef09f96b1b786e4df9..9cd6b3b9a66ed541f60072752e78947bafb53a8d 100644 (file)
@@ -1283,7 +1283,8 @@ Will throw an error if the archive version is too new."
   (let ((filename (expand-file-name file package-user-dir)))
     (when (file-exists-p filename)
       (with-temp-buffer
-        (insert-file-contents-literally filename)
+        (let ((coding-system-for-read 'utf-8))
+          (insert-file-contents filename))
         (let ((contents (read (current-buffer))))
           (if (> (car contents) package-archive-version)
               (error "Package archive version %d is higher than %d"