]> git.eshelyaron.com Git - emacs.git/commitdiff
Revert "DOn't use string-as-unibyte in Gnus"
authorLars Ingebrigtsen <larsi@gnus.org>
Wed, 1 Feb 2017 12:48:02 +0000 (13:48 +0100)
committerLars Ingebrigtsen <larsi@gnus.org>
Wed, 1 Feb 2017 12:49:11 +0000 (13:49 +0100)
This reverts commit d1c931009004aef847105b7bac6b6ffafd985b82.

Not all the cases where we had string-as-unibyte were characters,
so this needs to be considered more thoroughly before being redone.

lisp/gnus/canlock.el
lisp/gnus/gnus-art.el
lisp/gnus/gnus-srvr.el
lisp/gnus/gnus-start.el
lisp/gnus/mml.el
lisp/gnus/nnir.el
lisp/gnus/nnmail.el

index 6c28b1c66df8ffe44c07a27fe7765c7e33f21e20..9e13ced4670342c33a757da0fff2bf2cb8e995b1 100644 (file)
@@ -90,7 +90,7 @@ buffer does not look like a news message."
      (canlock-sha1
       (concat opad
              (canlock-sha1
-              (concat ipad (encode-coding-string message-id 'utf-8))))))))
+              (concat ipad (string-as-unibyte message-id))))))))
 
 (defun canlock-narrow-to-header ()
   "Narrow the buffer to the head of the message."
index d96c511ec0da681a367e71b61ffdea3bc60de2f9..a4ff840f75545690dd709f9bff44071993480faa 100644 (file)
@@ -2938,8 +2938,7 @@ message header will be added to the bodies of the \"text/html\" parts."
                                         (encode-coding-string
                                          title coding))
                                 body content))
-                      (setq eheader (encode-coding-string
-                                     (buffer-string) 'utf-8)
+                      (setq eheader (string-as-unibyte (buffer-string))
                             body content)))
                   (erase-buffer)
                   (mm-disable-multibyte)
index 67744cebc875e8f16e49cecc407a179eccf7ade5..bed5993b9c19d54eef064a73e917f3b06e685526 100644 (file)
@@ -821,13 +821,12 @@ claim them."
              (while (not (eobp))
                (ignore-errors
                  (push (cons
-                        (encode-coding-string
+                        (string-as-unibyte
                          (buffer-substring
                           (point)
                           (progn
                             (skip-chars-forward "^ \t")
-                            (point)))
-                         'utf-8)
+                            (point))))
                         (let ((last (read cur)))
                           (cons (read cur) last)))
                        groups))
@@ -835,7 +834,7 @@ claim them."
            (while (not (eobp))
              (ignore-errors
                (push (cons
-                      (encode-coding-string
+                      (string-as-unibyte
                        (if (eq (char-after) ?\")
                            (read cur)
                          (let ((p (point)) (name ""))
@@ -847,8 +846,7 @@ claim them."
                              (skip-chars-forward "^ \t\\\\")
                              (setq name (concat name (buffer-substring
                                                       p (point)))))
-                           name))
-                       'utf-8)
+                           name)))
                       (let ((last (read cur)))
                         (cons (read cur) last)))
                      groups))
index 2cefc78fb9e7ed09478b748270e7cd79add3d9fa..be46339cd38158ed69c308922224ae51d45bd693 100644 (file)
@@ -1990,7 +1990,7 @@ backend check whether the group actually exists."
     (while lists
       (setq killed (car lists))
       (while killed
-       (gnus-sethash (encode-coding-string (car killed) 'utf-8) nil hashtb)
+       (gnus-sethash (string-as-unibyte (car killed)) 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 (encode-coding-string (car elem) 'utf-8))))
+       (setcar elem (string-as-unibyte (car elem)))))
     (gnus-make-hashtable-from-newsrc-alist)
     (when (file-newer-than-file-p file ding-file)
       ;; Old format quick file
index aaadf0c7778d8e8595548de1b119fd79df3bc757..3a31349d378c2e41a76614a7f578eb96ca341b60 100644 (file)
@@ -696,10 +696,9 @@ be \"related\" or \"alternate\"."
              (set-buffer-multibyte nil)
              (cond
               ((cdr (assq 'buffer cont))
-               (insert (encode-coding-string
+               (insert (string-as-unibyte
                         (with-current-buffer (cdr (assq 'buffer cont))
-                          (buffer-string))
-                        'utf-8)))
+                          (buffer-string)))))
               ((and filename
                     (not (equal (cdr (assq 'nofile cont)) "yes")))
                (let ((coding-system-for-read mm-binary-coding-system))
index 174be65035f4f1480860206ec44cb542481f922c..9640f2c746f63d9ff7f13bf9b7373abf92a3dbbc 100644 (file)
@@ -1818,20 +1818,19 @@ article came from is also searched."
        (if (eq (car method) 'nntp)
            (while (not (eobp))
              (ignore-errors
-               (push (encode-coding-string
+               (push (string-as-unibyte
                       (gnus-group-full-name
                        (buffer-substring
                         (point)
                         (progn
                           (skip-chars-forward "^ \t")
                           (point)))
-                       method)
-                      'utf-8)
+                       method))
                      groups))
              (forward-line))
          (while (not (eobp))
            (ignore-errors
-             (push (encode-coding-string
+             (push (string-as-unibyte
                     (if (eq (char-after) ?\")
                         (gnus-group-full-name (read cur) method)
                       (let ((p (point)) (name ""))
@@ -1843,8 +1842,7 @@ article came from is also searched."
                           (skip-chars-forward "^ \t\\\\")
                           (setq name (concat name (buffer-substring
                                                    p (point)))))
-                        (gnus-group-full-name name method)))
-                    'utf-8)
+                        (gnus-group-full-name name method))))
                    groups))
            (forward-line)))))
     groups))
index 224d5db5427f508bc73dfc7af441dfd36757facb..3f2e08171e08ae6fef4d1efec36e98b26b271001 100644 (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 (encode-coding-string group 'utf-8) (cons min max))
+               (push (list (string-as-unibyte group) (cons min max))
                      group-assoc)))
        (error nil))
       (widen)
@@ -1251,9 +1251,8 @@ 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)))
-               (encode-coding-string
-                (format " %s:%d" (caar group-alist) (cdar group-alist))
-                'utf-8)))
+               (string-as-unibyte
+                (format " %s:%d" (caar group-alist) (cdar group-alist)))))
       (setq group-alist (cdr group-alist)))
     (insert "\n")))