emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Gnus; Restore multi encoding support for NNTP


From: Eric Abrahamsen
Subject: Re: Gnus; Restore multi encoding support for NNTP
Date: Mon, 27 Dec 2021 19:17:32 -0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

LdBeth <andpuke@foxmail.com> writes:

>>>>>> In <87sfueb3y1.fsf@gnus.org> 
>>>>>>  Lars Ingebrigtsen <larsi@gnus.org> wrote:
> Lars> LdBeth <andpuke@foxmail.com> writes:
>
> ldb> That would only solve the problem displaying the groups list from
> ldb> server-mode, after Gnus saves the decoded group names in
> ldb> ~/.newsrc.eld
> ldb> and reads in from a new session, it would not able to correctly
> ldb> figure
> ldb> out the original group name from the starup screen group-mode.
> ldb> That is
> ldb> why a mapping is needed (and it needs to be saved with the
> ldb> .newsrc.eld file).
>
> Lars> It knows the coding system to use for that group name, so it can
> Lars> use
> Lars> that when encoding the name, too, surely?
>
> Probably you mean using the coding system in
> `gnus-group-name-charset-group-alist'?
>
> That won't work in certain case, say, there's a group name on a server
> is
> "nntp+news.newsfan.net:\346\265\213\350\257\225" (in UTF-8)
> while the rest group names on that server are in GBK, so I set
>
> ```
> (setq gnus-group-name-charset-group-alist
>        '(("\346\265\213\350\257\225" . utf-8)
>          ("news\\.newsfan\\.net" . gbk)))
> ```
>
> And it's not able to use that to correct encode the names.

Trying to catch up here...

The moral intent of the changes in
cb12a84f2c519a48dd87453c925e3bc36d9944db was to move the site of group
name decoding from just-in-time conversion before display to the user,
to conversion over-the-wire when talking to the server. Meaning that
group name strings should be decoded as they arrive from the server, and
encoded before they're sent to the server. Locally (including in file
names for agent/cache files) they should always be utf-8-emacs.

`gnus-group-name-charset-group-alist' ought to be the right tool here,
but I'm not 100% sure that it is used correctly both for incoming and
outgoing group names.

Also it's obviously got a bit of a chicken-and-the-egg problem, in that
you can't match the regexp correctly unless you've already got the
properly-decoded group name.

> What's worse is when there are two group names having different coding
> systems decoded to the same UTF-8 string for the same server, if gnus
> doesn't correctly record which one uses which, well... (This is the
> reason for using charset string property for that)

Gnus does not handle this situation correctly, and I can't imagine it
ever did. But probably it should. How does this per-group encoding
information arrive from the server?

Eric



reply via email to

[Prev in Thread] Current Thread [Next in Thread]