Subject: Re: bug#70356: 30.0.50; [wishlist] Expose UTF-8 parse error to Lisp

From: Michael Albinus <[email-masked]>
Date: Sat, 13 Apr 2024 09:24:37 +0200

Eli Zaretskii <[email-masked]> 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.