diff --git a/gnus-group.el b/gnus-group.el index 2ec001f..c990158 100644 --- a/gnus-group.el +++ b/gnus-group.el @@ -1197,6 +1197,9 @@ The following commands are available: ;; FIXME: If we never have to coerce group names to unibyte now, how ;; much of this is necessary? How much encoding/decoding do we still ;; have to do? +;; At least, nntp method still needs this. +;; Maybe we can just reduce this function to just lookup +;; `gnus-group-name-charset-group-alist'. (defun gnus-group-name-charset (method group) (unless method (setq method (gnus-find-method-for-group group))) diff --git a/gnus-srvr.el b/gnus-srvr.el index fa880b7..39a94c1 100644 --- a/gnus-srvr.el +++ b/gnus-srvr.el @@ -775,13 +775,17 @@ claim them." (while (not (eobp)) (ignore-errors (push (cons - (decode-coding-string - (buffer-substring - (point) - (progn - (skip-chars-forward "^ \t") - (point))) - 'utf-8-emacs) + (let ((name + (buffer-substring + (point) + (progn + (skip-chars-forward "^ \t") + (point))))) + (if (eq (detect-coding-string name t) 'undecided) + name + (decode-coding-string + name + (inline (gnus-group-name-charset method name))))) (let ((last (read cur))) (cons (read cur) last))) groups)) diff --git a/gnus-util.el b/gnus-util.el index 8dbdcc8..f204e81 100644 --- a/gnus-util.el +++ b/gnus-util.el @@ -622,9 +622,9 @@ If N, return the Nth ancestor instead." (defmacro gnus-group-real-name (group) "Find the real name of a foreign newsgroup." `(let ((gname ,group)) - (if (string-match "^[^:]+:" gname) - (substring gname (match-end 0)) - gname))) + (encode-coding-string (if (string-match "^[^:]+:" gname) + (substring gname (match-end 0)) + (get-text-property 0 'charset gname))))) (defmacro gnus-group-server (group) "Find the server name of a foreign newsgroup.