]> git.eshelyaron.com Git - emacs.git/commitdiff
Rewrite string-as-unibyte/string-as-multibyte logic in nnmail
authorLars Ingebrigtsen <larsi@gnus.org>
Sat, 14 Apr 2018 22:24:02 +0000 (00:24 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Sat, 14 Apr 2018 22:24:02 +0000 (00:24 +0200)
* lisp/gnus/nnmail.el (nnmail-insert-xref): Rewrite
string-as-unibyte/string-as-multibyte logic and confirm that the
result is the same in both multibyte and unibyte buffers after the
change.

lisp/gnus/nnmail.el

index 249bd65a9d7521af4193b315e56f4fa6c3bf6b8f..d751f182e30c3059126eac52e58b5a513da13a58 100644 (file)
@@ -1250,10 +1250,10 @@ Return the number of characters in the body."
     (insert (format "Xref: %s" (system-name)))
     (while group-alist
       (insert (if (mm-multibyte-p)
-                 (string-as-multibyte
-                  (format " %s:%d" (caar group-alist) (cdar group-alist)))
-               (string-as-unibyte
-                (format " %s:%d" (caar group-alist) (cdar group-alist)))))
+                 (format " %s:%d" (caar group-alist) (cdar group-alist))
+               (encode-coding-string
+                (format " %s:%d" (caar group-alist) (cdar group-alist))
+                'utf-8)))
       (setq group-alist (cdr group-alist)))
     (insert "\n")))