From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/39174 Path: main.gmane.org!not-for-mail From: Simon Josefsson Newsgroups: gmane.emacs.gnus.general Subject: UTF-8 Support Date: Sat, 06 Oct 2001 23:19:26 +0200 Sender: owner-ding@hpc.uh.edu Message-ID: NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: main.gmane.org 1035174923 26483 80.91.224.250 (21 Oct 2002 04:35:23 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 21 Oct 2002 04:35:23 +0000 (UTC) Return-Path: Original-Received: (qmail 16716 invoked from network); 6 Oct 2001 21:20:07 -0000 Original-Received: from malifon.math.uh.edu (mail@129.7.128.13) by mastaler.com with SMTP; 6 Oct 2001 21:20:07 -0000 Original-Received: from sina.hpc.uh.edu ([129.7.128.10] ident=lists) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 15pyr6-0001SB-00; Sat, 06 Oct 2001 16:19:32 -0500 Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Sat, 06 Oct 2001 16:19:09 -0500 (CDT) Original-Received: from sclp3.sclp.com (qmailr@sclp3.sclp.com [209.196.61.66]) by sina.hpc.uh.edu (8.9.3/8.9.3) with SMTP id QAA13874 for ; Sat, 6 Oct 2001 16:18:57 -0500 (CDT) Original-Received: (qmail 16664 invoked by alias); 6 Oct 2001 21:19:14 -0000 Original-Received: (qmail 16654 invoked from network); 6 Oct 2001 21:19:13 -0000 Original-Received: from dolk.extundo.com (195.42.214.242) by gnus.org with SMTP; 6 Oct 2001 21:19:13 -0000 Original-Received: from barbar.josefsson.org (slipsten.extundo.com [195.42.214.241]) (authenticated bits=0) by dolk.extundo.com (8.12.0/8.12.0) with ESMTP id f96LJK0r001986; Sat, 6 Oct 2001 23:19:21 +0200 Original-To: ding@gnus.org, bugs@gnus.org Original-Lines: 169 User-Agent: Gnus/5.090004 (Oort Gnus v0.04) Emacs/21.0.106 Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:39174 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:39174 I committed the following to support UTF-8 group names better (which supposedly the USEFOR group is trying to migrate to). It should be possible to subscribe to dk.test.utf8-=E6=F8=E5 from sunsite.dk and things should work. There may be problems when Gcc'ing UTF-8 names though, patches welcome. You need to frob `gnus-group-name-charset-group-alist' to something like `((".*" . utf-8))' though. Per, do you want to commit the change to what you suggested? >>From GNUS-NEWS: ** Group names are treated as UTF-8 by default. This is supposedly what USEFOR wants to migrate to. See `gnus-group-name-charset-group-alist' and `gnus-group-name-charset-method-alist' for customization. ChangeLog entry: 2001-10-06 Simon Josefsson Support UTF-8 group names better. =09 * message.el (message-check-news-header-syntax): Encode group names before comparison. * gnus-msg.el (gnus-copy-article-buffer): Run all `gnus-article-decode-hook's except `article-decode-charset' instead of hardcoding call to one of them. * gnus-art.el (gnus-article-decode-hook): Add `article-decode-group-name'. (article-decode-group-name): New function, use `g-d-n'. * gnus-group.el (gnus-group-insert-group-line): Decode gnus-tmp-group using `g-d-n'. * gnus-util.el (gnus-decode-newsgroups): New function. The patch: Index: gnus-art.el =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /usr/local/cvsroot/gnus/lisp/gnus-art.el,v retrieving revision 6.109 diff -u -r6.109 gnus-art.el --- gnus-art.el 2001/09/28 11:22:41 6.109 +++ gnus-art.el 2001/10/06 21:04:01 @@ -638,7 +638,8 @@ (face :value default))))) =20 (defcustom gnus-article-decode-hook - '(article-decode-charset article-decode-encoded-words) + '(article-decode-charset article-decode-encoded-words + article-decode-group-name) "*Hook run to decode charsets in articles." :group 'gnus-article-headers :type 'hook) @@ -1753,6 +1754,22 @@ (save-restriction (article-narrow-to-head) (funcall gnus-decode-header-function (point-min) (point-max))))) + +(defun article-decode-group-name () + "Decode group names in `Newsgroups:'." + (let ((inhibit-point-motion-hooks t) + buffer-read-only + (method (gnus-find-method-for-group gnus-newsgroup-name))) + (when (and (or gnus-group-name-charset-method-alist + gnus-group-name-charset-group-alist) + (gnus-buffer-live-p gnus-original-article-buffer) + (mail-fetch-field "Newsgroups")) + (nnheader-replace-header "Newsgroups" + (gnus-decode-newsgroups + (with-current-buffer + gnus-original-article-buffer + (mail-fetch-field "Newsgroups")) + gnus-newsgroup-name method))))) =20 (defun article-de-quoted-unreadable (&optional force read-charset) "Translate a quoted-printable-encoded article. Index: gnus-group.el =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /usr/local/cvsroot/gnus/lisp/gnus-group.el,v retrieving revision 6.40 diff -u -r6.40 gnus-group.el --- gnus-group.el 2001/09/29 19:25:31 6.40 +++ gnus-group.el 2001/10/06 21:04:02 @@ -1339,7 +1339,9 @@ (point) (prog1 (1+ (point)) ;; Insert the text. - (eval gnus-group-line-format-spec)) + (let ((gnus-tmp-group (gnus-group-name-decode + gnus-tmp-group group-name-charset))) + (eval gnus-group-line-format-spec))) `(gnus-group ,(gnus-intern-safe gnus-tmp-group gnus-active-hashtb) gnus-unread ,(if (numberp number) (string-to-int gnus-tmp-number-of-unread) Index: gnus-msg.el =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /usr/local/cvsroot/gnus/lisp/gnus-msg.el,v retrieving revision 6.47 diff -u -r6.47 gnus-msg.el --- gnus-msg.el 2001/09/23 06:17:41 6.47 +++ gnus-msg.el 2001/10/06 21:04:03 @@ -579,7 +579,10 @@ (or (message-goto-body) (point-max))) ;; Insert the original article headers. (insert-buffer-substring gnus-original-article-buffer beg end) - (article-decode-encoded-words)))) + ;; Decode charsets. + (let ((gnus-article-decode-hook + (delq 'article-decode-charset gnus-article-decode-hook))) + (run-hooks 'gnus-article-decode-hook))))) gnus-article-copy))) =20 (defun gnus-post-news (post &optional group header article-buffer yank sub= ject Index: gnus-util.el =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /usr/local/cvsroot/gnus/lisp/gnus-util.el,v retrieving revision 6.19 diff -u -r6.19 gnus-util.el --- gnus-util.el 2001/08/24 04:43:11 6.19 +++ gnus-util.el 2001/10/06 21:04:03 @@ -187,6 +187,14 @@ (search-forward ":" eol t) (point))))) =20 +(defun gnus-decode-newsgroups (newsgroups group &optional method) + (let ((method (or method (gnus-find-method-for-group group)))) + (mapconcat (lambda (group) + (gnus-group-name-decode group (gnus-group-name-charset + method group))) + (message-tokenize-header newsgroups ", ") + ", "))) + (defun gnus-remove-text-with-property (prop) "Delete all text in the current buffer with text property PROP." (save-excursion Index: message.el =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /usr/local/cvsroot/gnus/lisp/message.el,v retrieving revision 6.119 diff -u -r6.119 message.el --- message.el 2001/09/29 19:25:32 6.119 +++ message.el 2001/10/06 21:04:04 @@ -2915,12 +2915,15 @@ (if followup-to (concat newsgroups "," followup-to) newsgroups))) + (method (if (message-functionp message-post-method) + (funcall message-post-method) + message-post-method)) (known-groups - (mapcar (lambda (n) (gnus-group-real-name n)) - (gnus-groups-from-server - (if (message-functionp message-post-method) - (funcall message-post-method) - message-post-method)))) + (mapcar (lambda (n) + (gnus-group-name-decode=20 + (gnus-group-real-name n) + (gnus-group-name-charset method n))) + (gnus-groups-from-server method))) errors) (while groups (unless (or (equal (car groups) "poster")