1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-08 04:30:45 -08:00
emacs/test/src
Philipp Stephani a5835dfee1 Improve error reporting when serializing non-Unicode strings to JSON
* src/coding.c (utf8_string_p): New helper function.
(syms_of_coding) <utf-8-unix>: Move from json.c.

* src/json.c (json_check_utf8): New helper function.
(lisp_to_json_toplevel_1, lisp_to_json): Use it.  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.
2017-12-30 23:16:51 +01:00
..
regex-resources
alloc-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
buffer-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
callproc-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
casefiddle-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
charset-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
chartab-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
cmds-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
coding-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
data-tests.el Make logcount act like CL on negative arg 2017-09-30 15:38:14 -07:00
decompress-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
doc-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
editfns-tests.el Fix zero-padding bug with (format "%#08x" n) 2017-12-07 18:08:56 -08:00
emacs-module-tests.el ; Replace non-ascii quote characters in doc strings etc 2017-12-20 16:23:11 -05:00
eval-tests.el ; Replace non-ascii quote characters in doc strings etc 2017-12-20 16:23:11 -05:00
fileio-tests.el Unbreak a fileio test on non-Mac OS X systems 2017-12-20 14:28:04 -05:00
floatfns-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
fns-tests.el ; Replace non-ascii quote characters in doc strings etc 2017-12-20 16:23:11 -05:00
font-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
inotify-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
json-tests.el Improve error reporting when serializing non-Unicode strings to JSON 2017-12-30 23:16:51 +01:00
keyboard-tests.el ; * test/src/keyboard-tests.el: Standardize copyright and license. 2017-11-07 18:59:35 -05:00
keymap-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
lcms-tests.el Add CAM02 JCh and CAM02-UCS J'a'b' conversions 2017-09-30 08:00:53 -04:00
lread-tests.el Raise an error when detecting old-style backquotes. 2017-12-09 21:24:05 +01:00
marker-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
minibuf-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
print-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
process-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
regex-tests.el ; Replace non-ascii quote characters in doc strings etc 2017-12-20 16:23:11 -05:00
syntax-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
textprop-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
thread-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
undo-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
xml-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00