From 3460502128ab6ac4b68d9b5dce5d1602547e7d67 Mon Sep 17 00:00:00 2001 From: Eric Abrahamsen Date: Tue, 23 Apr 2019 20:32:02 -0700 Subject: [PATCH] Decode Gnus group names when browsing server group lists * lisp/gnus/gnus-srvr.el (gnus-browse-foreign-server): The coding system for the nntp-server-buffer is 'binary; decode group names as 'utf-8-emacs. --- lisp/gnus/gnus-srvr.el | 38 +++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/lisp/gnus/gnus-srvr.el b/lisp/gnus/gnus-srvr.el index 2328f1da163..da110c8bbfa 100644 --- a/lisp/gnus/gnus-srvr.el +++ b/lisp/gnus/gnus-srvr.el @@ -784,11 +784,13 @@ claim them." (while (not (eobp)) (ignore-errors (push (cons - (buffer-substring - (point) - (progn - (skip-chars-forward "^ \t") - (point))) + (decode-coding-string + (buffer-substring + (point) + (progn + (skip-chars-forward "^ \t") + (point))) + 'utf-8-emacs) (let ((last (read cur))) (cons (read cur) last))) groups)) @@ -796,18 +798,20 @@ claim them." (while (not (eobp)) (ignore-errors (push (cons - (if (eq (char-after) ?\") - (read cur) - (let ((p (point)) (name "")) - (skip-chars-forward "^ \t\\\\") - (setq name (buffer-substring p (point))) - (while (eq (char-after) ?\\) - (setq p (1+ (point))) - (forward-char 2) - (skip-chars-forward "^ \t\\\\") - (setq name (concat name (buffer-substring - p (point))))) - name)) + (decode-coding-string + (if (eq (char-after) ?\") + (read cur) + (let ((p (point)) (name "")) + (skip-chars-forward "^ \t\\\\") + (setq name (buffer-substring p (point))) + (while (eq (char-after) ?\\) + (setq p (1+ (point))) + (forward-char 2) + (skip-chars-forward "^ \t\\\\") + (setq name (concat name (buffer-substring + p (point))))) + name)) + 'utf-8-emacs) (let ((last (read cur))) (cons (read cur) last))) groups)) -- 2.39.5