emacs-devel
[Top][All Lists]
Advanced

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

Re: [Emacs-diffs] scratch/gnus-decoded f041412 1/7: Decode group names i


From: Andreas Schwab
Subject: Re: [Emacs-diffs] scratch/gnus-decoded f041412 1/7: Decode group names in newsrc files as raw-text, not utf-8
Date: Sat, 22 Jun 2019 10:20:05 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2.90 (gnu/linux)

On Jun 21 2019, Eric Abrahamsen <address@hidden> wrote:

> In scratch/gnus-decoded, the group name is the string "nnml:テスト". It
> is written to newsrc with:
>
> (with-current-buffer buf
>   (insert "nnml:テスト")
>   (let ((coding-system-for-write 'raw-text))
>     (save-buffer)))
>
> And read with:
>
> (set-buffer (nnheader-find-file-noselect newsrc-file))
> (setq group (read (current-buffer))
>       group (decode-coding-string
>            (symbol-name group) 'raw-text))

The coding rules for symbols and strings are quite different.  If you
want read a symbol, you need to write a symbol.

Andreas.

-- 
Andreas Schwab, address@hidden
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."



reply via email to

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