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


Message #22 received at 70356-done <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Andreas Schwab <schwab <at> linux-m68k.org>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 70356-done <at> debbugs.gnu.org
Subject: Re: bug#70356: 30.0.50; [wishlist] Expose UTF-8 parse error to Lisp
Date: Sat, 13 Apr 2024 10:29:26 +0200
Andreas Schwab <schwab <at> linux-m68k.org> writes:

Hi Andreas,

>> 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.
>
> That function could do the decoding and then check whether the result
> contains any eight-bit characters (which mark the non-decodable parts).

Hmm. Thinking about, the following code does already what I want:

(string-to-unibyte (apply #'string bytes))

Closing the bug.

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.