unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: <tomas@tuxteam.de>
To: Eli Zaretskii <eliz@gnu.org>
Cc: help-gnu-emacs@gnu.org
Subject: Re: url-retrieve and encoding
Date: Sat, 10 Feb 2024 20:49:08 +0100	[thread overview]
Message-ID: <ZcfTNDFb1SlYcC7R@tuxteam.de> (raw)
In-Reply-To: <86a5o8t8dg.fsf@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 1031 bytes --]

On Sat, Feb 10, 2024 at 09:41:15PM +0200, Eli Zaretskii wrote:
> > 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?)

Thanks, Eli

I posted "my" whole Lisp program in whole (it is basically just
`url-retrieve-synchronously'. But perhaps the source has no
CRs? At least, "curl -I" shows some. Next mystery :)

> > Is there a canonical way to "make the buffer be UTF-8?
> 
> Yes: decode-coding-region.

Ahhh -- thanks a bunch for this one! How could I have missed it.

> > (...) But that feels
> > a bit... gross:
> 
> Indeed.  Why didn't you try decoding to begin with?

Lack of knowledge it seems. My doc-fu let me down. Thanks
for setting me off in the right direction.

Cheers
-- 
t

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

  reply	other threads:[~2024-02-10 19:49 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-10 19:31 url-retrieve and encoding tomas
2024-02-10 19:41 ` Eli Zaretskii
2024-02-10 19:49   ` tomas [this message]
2024-02-11 17:49     ` tomas
2024-02-11 19:21       ` Eli Zaretskii
2024-02-12  5:30         ` tomas
2024-02-10 20:51 ` Tim Landscheidt
2024-02-11  6:30   ` tomas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZcfTNDFb1SlYcC7R@tuxteam.de \
    --to=tomas@tuxteam.de \
    --cc=eliz@gnu.org \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).