1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-01-08 15:35:02 +00:00

DOn't use string-as-unibyte in Gnus

* lisp/gnus/nnmail.el (nnmail-parse-active): Don't use
string-as-unibyte.
(nnmail-insert-xref): Ditto.

* lisp/gnus/canlock.el (canlock-make-cancel-key): Ditto.

* lisp/gnus/gnus-art.el (gnus-article-browse-html-parts): Ditto.

* lisp/gnus/gnus-srvr.el (gnus-browse-foreign-server): Ditto.
(gnus-browse-foreign-server): Ditto.
(gnus-browse-foreign-server): Ditto.

* lisp/gnus/gnus-start.el
(gnus-update-active-hashtb-from-killed): Ditto.
(gnus-read-newsrc-el-file): Ditto.

* lisp/gnus/mml.el (mml-generate-mime-1): Ditto.

* lisp/gnus/nnir.el (nnir-get-active): Ditto.
(nnir-get-active): Ditto.
This commit is contained in:
Lars Ingebrigtsen 2017-01-31 17:52:51 +01:00
parent 18a3fccd89
commit d1c9310090
7 changed files with 24 additions and 17 deletions

View File

@ -90,7 +90,7 @@ buffer does not look like a news message."
(canlock-sha1
(concat opad
(canlock-sha1
(concat ipad (string-as-unibyte message-id))))))))
(concat ipad (encode-coding-string message-id 'utf-8))))))))
(defun canlock-narrow-to-header ()
"Narrow the buffer to the head of the message."

View File

@ -2938,7 +2938,8 @@ message header will be added to the bodies of the \"text/html\" parts."
(encode-coding-string
title coding))
body content))
(setq eheader (string-as-unibyte (buffer-string))
(setq eheader (encode-coding-string
(buffer-string) 'utf-8)
body content)))
(erase-buffer)
(mm-disable-multibyte)

View File

@ -821,12 +821,13 @@ claim them."
(while (not (eobp))
(ignore-errors
(push (cons
(string-as-unibyte
(encode-coding-string
(buffer-substring
(point)
(progn
(skip-chars-forward "^ \t")
(point))))
(point)))
'utf-8)
(let ((last (read cur)))
(cons (read cur) last)))
groups))
@ -834,7 +835,7 @@ claim them."
(while (not (eobp))
(ignore-errors
(push (cons
(string-as-unibyte
(encode-coding-string
(if (eq (char-after) ?\")
(read cur)
(let ((p (point)) (name ""))
@ -846,7 +847,8 @@ claim them."
(skip-chars-forward "^ \t\\\\")
(setq name (concat name (buffer-substring
p (point)))))
name)))
name))
'utf-8)
(let ((last (read cur)))
(cons (read cur) last)))
groups))

View File

@ -1990,7 +1990,7 @@ backend check whether the group actually exists."
(while lists
(setq killed (car lists))
(while killed
(gnus-sethash (string-as-unibyte (car killed)) nil hashtb)
(gnus-sethash (encode-coding-string (car killed) 'utf-8) nil hashtb)
(setq killed (cdr killed)))
(setq lists (cdr lists)))))
@ -2453,7 +2453,7 @@ If FORCE is non-nil, the .newsrc file is read."
(dolist (elem gnus-newsrc-alist)
;; Protect against broken .newsrc.el files.
(when (car elem)
(setcar elem (string-as-unibyte (car elem)))))
(setcar elem (encode-coding-string (car elem) 'utf-8))))
(gnus-make-hashtable-from-newsrc-alist)
(when (file-newer-than-file-p file ding-file)
;; Old format quick file

View File

@ -696,9 +696,10 @@ be \"related\" or \"alternate\"."
(set-buffer-multibyte nil)
(cond
((cdr (assq 'buffer cont))
(insert (string-as-unibyte
(insert (encode-coding-string
(with-current-buffer (cdr (assq 'buffer cont))
(buffer-string)))))
(buffer-string))
'utf-8)))
((and filename
(not (equal (cdr (assq 'nofile cont)) "yes")))
(let ((coding-system-for-read mm-binary-coding-system))

View File

@ -1818,19 +1818,20 @@ article came from is also searched."
(if (eq (car method) 'nntp)
(while (not (eobp))
(ignore-errors
(push (string-as-unibyte
(push (encode-coding-string
(gnus-group-full-name
(buffer-substring
(point)
(progn
(skip-chars-forward "^ \t")
(point)))
method))
method)
'utf-8)
groups))
(forward-line))
(while (not (eobp))
(ignore-errors
(push (string-as-unibyte
(push (encode-coding-string
(if (eq (char-after) ?\")
(gnus-group-full-name (read cur) method)
(let ((p (point)) (name ""))
@ -1842,7 +1843,8 @@ article came from is also searched."
(skip-chars-forward "^ \t\\\\")
(setq name (concat name (buffer-substring
p (point)))))
(gnus-group-full-name name method))))
(gnus-group-full-name name method)))
'utf-8)
groups))
(forward-line)))))
groups))

View File

@ -665,7 +665,7 @@ nn*-request-list should have been called before calling this function."
(setq group (symbol-name group)))
(if (and (numberp (setq max (read buffer)))
(numberp (setq min (read buffer))))
(push (list (string-as-unibyte group) (cons min max))
(push (list (encode-coding-string group 'utf-8) (cons min max))
group-assoc)))
(error nil))
(widen)
@ -1251,8 +1251,9 @@ Return the number of characters in the body."
(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)))))
(encode-coding-string
(format " %s:%d" (caar group-alist) (cdar group-alist))
'utf-8)))
(setq group-alist (cdr group-alist)))
(insert "\n")))