[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: url-retrieve and encoding
From: |
Eli Zaretskii |
Subject: |
Re: url-retrieve and encoding |
Date: |
Sat, 10 Feb 2024 21:41:15 +0200 |
> Date: Sat, 10 Feb 2024 20:31:02 +0100
> From: <tomas@tuxteam.de>
>
> IIUC, url-retrieve (and its sinchronous friend) are the tools for
> the job. They work nicely, but they leave me with a unibyte buffer
> (confusingly, the line endings are just linefeeds: from the HTTP
> specs I'd expected "\r\n")
(Maybe your Lisp program decoded the EOLs?)
> Is there a canonical way to "make the buffer be UTF-8?
Yes: decode-coding-region.
> What I've come up is to take the buffer-substring starting from
> after the first empty line to the end, do a "string-as-multibyte"
> with that and insert that into a fresh buffer. But that feels
> a bit... gross:
Indeed. Why didn't you try decoding to begin with?
Re: url-retrieve and encoding, Tim Landscheidt, 2024/02/10