I've not seen the RFC but you say "JSON only has 5 whitespace characters" and 
then list only 4, and your patched array only has four 1's. ?Have you missed 
one, or is the 5 wrong (or am I missing something)?

Graham

Sent from Samsung Mobile

-------- Original message --------
From: Jan Nijtmans <jan.nijtm...@gmail.com> 
Date: 16/10/2015  14:33  (GMT+00:00) 
To: General Discussion of SQLite Database <sqlite-users at 
mailinglists.sqlite.org> 
Subject: [sqlite] Form-Feed (0x0C) is not a space character in JSON 

Hi all,

Just noted in the jsonIsSpace[] array: According to RFC 7159, JSON
only has 5 whitespace characters, FF (0x0C) is not among them:

????? ws = *(
??????????????? %x20 /????????????? ; Space
??????????????? %x09 /????????????? ; Horizontal tab
??????????????? %x0A /????????????? ; Line feed or New line
??????????????? %x0D??????????????? ; Carriage return
??????????? )

Suggested patch below.

Regards,
???????? Jan Nijtmans
$ fossil diff
Index: ext/misc/json1.c
==================================================================
--- ext/misc/json1.c
+++ ext/misc/json1.c
@@ -50,11 +50,11 @@
** Growing our own isspace() routine this way is twice as fast as
** the library isspace() function, resulting in a 7% overall performance
** increase for the parser. (Ubuntu14.10 gcc 4.8.4 x64 with -Os).
*/
static const char jsonIsSpace[] = {
-? 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0,
+? 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0,
?? 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
?? 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
?? 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
?? 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
?? 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
_______________________________________________
sqlite-users mailing list
sqlite-users at mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to