emacs-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] Gnus; Restore multi encoding support for NNTP


From: LdBeth
Subject: Re: [PATCH] Gnus; Restore multi encoding support for NNTP
Date: Mon, 03 Jan 2022 22:00:42 +0800
User-agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (Gojō) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.2 (x86_64-apple-darwin18.7.0) MULE/6.0 (HANACHIRUSATO)

>>>>> In <87v8z13w54.fsf@gnus.org> 
>>>>>   Lars Ingebrigtsen <larsi@gnus.org> wrote:
Lars> LdBeth <andpuke@foxmail.com> writes:

>> +  (let ((pos (text-property-not-all 0 (length string) 'charset nil string)))
>> +    (if pos (encode-coding-string string (get-text-property pos 'charset 
>> string))
>> +      string)))

Lars> Like I said before, I'm not really very enthusiastic about
Lars> stashing this data in the text properties -- it's quite likely
Lars> that there are packages or functions of there that'll do various
Lars> transforms on the group names, and the text properties may be
Lars> lost.  If this data has to be stored non-ephemerally, then
Lars> storing it in the group parameter list, for instance, would be
Lars> less brittle.

Thanks for the suggestion, it seems possible to add the coding
information group parameter list so the newsrc.eld file can still be
saved with ASCII coding. However, before the group has been subscribed
and added to `gnus-newsrc-hashtb', the charset information seems has
no other place to be stored unless we add another bookkeeping
facility.

For the group names, they are store under the text property in group
mode buffer and are retrieved via `(get-text-property (point)
'gnus-group)', it seems these are only been looked up and compared.

Or maybe we could just prepend the charset information to the decoded
group name. For example instead of `nntp+news.server.net:group.name'
it becomes `nntp-gbk+news.server.net:group.name'. In that case the
info is still attached with group name, and can certainly undergoes
most of the transformations.


>> @@ -472,7 +472,7 @@ gnus-request-compact-group
>>       (result
>>        (funcall (gnus-get-function gnus-command-method
>>                                    'request-compact-group)
>> -               (gnus-group-real-name group)
>> +               (gnus-group-real-name (gnus-group-encoded-name group))
>>                 (nth 1 gnus-command-method) t)))
>>      result))

Lars> (etc.)  And I'm not sure about giving the backends the encoded names --
Lars> that's a major change in behaviour, and has to end up causing problems
Lars> somewhere (for instance, in nnimap which is encoded to utf-7, and would
Lars> be double-encoded if there's a `charset' text property on the group
Lars> name).

In older version it's just a call to `string-as-unibyte'.  And for
nnimap, the `gnus-group-name-charset' function already avoids doing
extra encoding.

-- 
LDB



reply via email to

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