emacs-devel
[Top][All Lists]
Advanced

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

Fixing Gnus, and string encoding question


From: Eric Abrahamsen
Subject: Fixing Gnus, and string encoding question
Date: Fri, 05 Apr 2019 13:47:32 -0700
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

So I've made a hash of this change (ha), and am trying to figure out the
best solution.

The problem is that non-ASCII group names are now strings, and are
coming into the system in two different ways: written into .newsrc.eld
with `print-escape-nonascii' set to t, and read off the filesystem using
a buffer with mutibyte disabled. The two methods don't match up -- the
strings are different.

Katsumi Yamaoka's example is the group whose decoded name is "nnml:テス
ト". This is written to .newsrc.eld as the string:

"nnml:\343\203\206\343\202\271\343\203\210"

Those aren't actual escapes, just backslashes and numbers.

The group name is read from file with `set-buffer-multibyte' nil, using
`read' to pick the group name up as a symbol, then using `symbol-name'
to turn it into a string. The symbol looks like:

nnml:\343\203\206\343\202\271\343\203\210 

And the resulting string is:

"nnml:ã\203\206ã\202¹ã\203\210"

Where the escapes are real escapes, I've typed them out here. The two
strings aren't `equal', obviously.

I don't know how to turn either of these strings into the other --
either direction would work, but I don't know how.

Another option is to give up messing with strings, and back the changes
halfway out: still use hash tables, but leave the group names as
symbols, with their current funky encoding. That's probably how I should
have sliced these changes to begin with. Then a later step would be to
go straight from symbols to fully decoded strings.

Hoping for some guidance,
Eric




reply via email to

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