emacs-devel
[Top][All Lists]
Advanced

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

Re: Fixing Gnus, and string encoding question


From: Andreas Schwab
Subject: Re: Fixing Gnus, and string encoding question
Date: Sun, 07 Apr 2019 14:18:17 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux)

On Apr 07 2019, Noam Postavsky <address@hidden> wrote:

> On Sun, 7 Apr 2019 at 00:10, Eric Abrahamsen <address@hidden> wrote:
>
>> You can get the string I'm fighting with by saving the attached file and
>> running:
>>
>> (with-temp-buffer
>>   (set-buffer-multibyte t)
>>   (let ((coding-system-for-read 'raw-text))
>>     (insert-file-contents "active")
>>     (goto-char (point-min))
>>     (symbol-name (read (current-buffer)))))
>>
>> I'm trying to turn that into something that looks like
>> "nnml:ã\203\206ã\202¹ã\203\210"
>
> Ah, needs multibyte-char-to-unibyte:
>
> (apply #'string
>        (mapcar #'multibyte-char-to-unibyte
>                (with-temp-buffer
>                  (set-buffer-multibyte t)
>                  (let ((coding-system-for-read 'raw-text))
>                    (insert-file-contents "active")
>                    (goto-char (point-min))
>                    (symbol-name (read (current-buffer)))))))

(encode-coding-string (symbol-name (read (current-buffer))) 'raw-text)

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]