GNU bug report logs - #70356
30.0.50; [wishlist] Expose UTF-8 parse error to Lisp

Previous Next

Package: emacs;

Reported by: Michael Albinus <michael.albinus <at> gmx.de>

Date: Fri, 12 Apr 2024 16:00:02 UTC

Severity: wishlist

Tags: notabug

Found in version 30.0.50

Done: Michael Albinus <michael.albinus <at> gmx.de>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 70356 <at> debbugs.gnu.org
Subject: bug#70356: 30.0.50; [wishlist] Expose UTF-8 parse error to Lisp
Date: Sat, 13 Apr 2024 09:24:37 +0200
Eli Zaretskii <eliz <at> gnu.org> writes:

Hi Eli,

>> json_parse_string checks for a valid UTF-8 byte sequence, and raises an
>> error in case of. It would be useful, if this error handling would be
>> exposed to Lisp. For example, it could be used to check a D-Bus
>> byte-array for proper UTF-8 syntax in dbus-byte-array-to-string.
>
> Sorry, I don't understand: errors we signal are always "exposed to
> Lisp": e.g., your program could catch the error and do whatever it
> wants.  What exactly is missing?

I'm not interested in JSON here. I've mentioned json_parse_string
because it contains the functionality I'm looking for.

What I'd like to get is a function, which takes a sequence of bytes as
arguments, and which indicates, whether this is a valid UTF-8 byte
sequence. This indication could be an error, or a respective return
value.

Best regards, Michael.




This bug report was last modified 1 year and 40 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.