all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: help-gnu-emacs@gnu.org
Subject: Re: Decoding URLs input
Date: Sun, 04 Jul 2021 07:22:25 +0300	[thread overview]
Message-ID: <83czryiu7y.fsf@gnu.org> (raw)
In-Reply-To: <CAP_d_8Wg5zoTyP9AfjpEMzm1p0+_xT68fTLTUnno=LfoHA7hbQ@mail.gmail.com> (message from Yuri Khan on Sun, 4 Jul 2021 03:16:37 +0700)

> From: Yuri Khan <yuri.v.khan@gmail.com>
> Date: Sun, 4 Jul 2021 03:16:37 +0700
> 
> I just fed it some percent-encoded sequences that I knew would result
> in invalid UTF-8 when decoded. If it were doing a full decode, I
> expected it to signal an error. It didn’t.

That's not a reliable sign that a function returns unibyte strings.
Most Emacs APIs that decode strings don't signal errors if they
encounter invalid sequences; instead, they decode those into raw
bytes.  The design principle is to support raw bytes in strings and
let the application deal with them if they are not expected.



      parent reply	other threads:[~2021-07-04  4:22 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-03  9:40 Decoding URLs input Jean Louis
2021-07-03  9:56 ` Jean Louis
2021-07-03 11:10 ` Yuri Khan
2021-07-03 12:04   ` Jean Louis
2021-07-03 19:17   ` Jean Louis
2021-07-03 20:16     ` Yuri Khan
2021-07-03 22:18       ` Jean Louis
2021-07-04  4:22       ` Eli Zaretskii [this message]

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

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

  git send-email \
    --in-reply-to=83czryiu7y.fsf@gnu.org \
    --to=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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.