* src/coding.h (EOL_SEEN_NONE, EOL_SEEN_LF, EOL_SE=
EN_CR)
(EOL_SEEN_CRLF): Move from coding.c.
* src/coding.c (check_utf_8): Make extern.
* src/json.c (json_check_utf8): New helper function.
(lisp_to_json_toplevel_1, lisp_to_json): Use it.=C2=A0 To save a bit of
time, check for invalid UTF-8 strings only after encountering an
error, since Jansson already rejects them.
* test/src/json-tests.el (json-serialize/invalid-unicode): Adapt
expected error symbol.
I've pushed a slight variant of this p=
atch to master as a5835dfee1. The only difference is that the UTF-8 check i=
s factored out into a helper function in coding.c.=C2=A0