From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Eric Abrahamsen Newsgroups: gmane.emacs.devel Subject: Re: Fixing Gnus, and string encoding question Date: Sat, 06 Apr 2019 19:30:52 -0700 Message-ID: <87pnpysg0z.fsf@ericabrahamsen.net> References: <87d0m0qivv.fsf@ericabrahamsen.net> <87zhp3swit.fsf@ericabrahamsen.net> <83d0lzbqnv.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="139439"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Apr 07 04:31:44 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hCxax-000aBe-Pz for ged-emacs-devel@m.gmane.org; Sun, 07 Apr 2019 04:31:43 +0200 Original-Received: from localhost ([127.0.0.1]:33305 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hCxaw-0000lm-5f for ged-emacs-devel@m.gmane.org; Sat, 06 Apr 2019 22:31:42 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:48295) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hCxaL-0000lU-Ik for emacs-devel@gnu.org; Sat, 06 Apr 2019 22:31:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hCxaK-0000XV-EY for emacs-devel@gnu.org; Sat, 06 Apr 2019 22:31:05 -0400 Original-Received: from [195.159.176.226] (port=47574 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hCxaK-0000X2-5Z for emacs-devel@gnu.org; Sat, 06 Apr 2019 22:31:04 -0400 Original-Received: from list by blaine.gmane.org with local (Exim 4.89) (envelope-from ) id 1hCxaI-000ZKX-2m for emacs-devel@gnu.org; Sun, 07 Apr 2019 04:31:02 +0200 X-Injected-Via-Gmane: http://gmane.org/ Cancel-Lock: sha1:THAGbz3duX4SHM345gWKPEgvLmo= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 195.159.176.226 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:235051 Archived-At: Eli Zaretskii writes: >> From: Eric Abrahamsen >> Date: Fri, 05 Apr 2019 19:22:18 -0700 >> Cc: Emacs developers >> >> > (decode-coding-string >> > "nnml:\343\203\206\343\202\271\343\203\210" 'utf-8) ;=> "nnml:テスト" >> > >> > (decode-coding-string >> > (symbol-name (read "nnml:\343\203\206\343\202\271\343\203\210")) >> > 'utf-8) ;=> "nnml:テスト" >> >> No, unfortunately -- that would make everything much easier. Eventually >> the idea will be to decode the strings into plain utf-8-emacs, but for >> now I'm stuck keeping them in this weird half-state. I literally need a >> conversion between the two versions above. > > Why do you need to keep these strings undecoded? Andreas Schwab writes: > Why do you need to use the escaped representation? > >> The group name is read from file with `set-buffer-multibyte' nil, > > Why can't you decode the file contents first, before passing it to read? That's the eventual plan. Gnus had the names encoded because they were kept as symbols. I didn't want to go in one fell swoop from encoded strings interned in obarrays to completely decoded strings kept in hash tables, because I assumed I would screw something up and break Gnus and annoy everyone. So that worked out well... But I should have done encoded symbols kept in hash tables as the first intermediate step. Eric