]> git.eshelyaron.com Git - emacs.git/commit
Fix json-insert unibyte buffer bug (bug#70007)
authorMattias EngdegÄrd <mattiase@acm.org>
Tue, 2 Apr 2024 16:58:09 +0000 (18:58 +0200)
committerEshel Yaron <me@eshelyaron.com>
Wed, 3 Apr 2024 06:48:04 +0000 (08:48 +0200)
commitf75893a771d8e13e3ab334dff5548fb1effd6526
tree574e41140a9408bbc1febd6217b09a911b8da8ab
parentc76669849efd275e940f395e169f3da5d961da0d
Fix json-insert unibyte buffer bug (bug#70007)

Previously, a unibyte target buffer could be put in an incorrect state
if json-insert was used to insert non-ASCII characters.

* src/json.c (Fjson_insert): Simplify.  Don't attempt to decode the data
being inserted: it is guaranteed to be correct UTF-8 and is correct for
both unibyte and multibyte buffers.
* test/src/json-tests.el (json-serialize/roundtrip)
(json-serialize/roundtrip-scalars): Extend tests.

(cherry picked from commit 617debf67392946b4b42fdf364c69da6f094a840)
src/json.c
test/src/json-tests.el