[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#70356: 30.0.50; [wishlist] Expose UTF-8 parse error to Lisp
From: |
Michael Albinus |
Subject: |
bug#70356: 30.0.50; [wishlist] Expose UTF-8 parse error to Lisp |
Date: |
Sat, 13 Apr 2024 10:29:26 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
Andreas Schwab <schwab@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.