File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -332,7 +332,9 @@ void JsonStreamingParser::processUnicodeCharacter(char c) {
332332
333333 if (unicodeBufferPos == 4 ) {
334334 int codepoint = getHexArrayAsDecimal (unicodeBuffer, unicodeBufferPos);
335- if (codepoint >= 0xD800 && codepoint < 0xDC00 ) {
335+ endUnicodeCharacter (codepoint);
336+ return ;
337+ /* if (codepoint >= 0xD800 && codepoint < 0xDC00) {
336338 unicodeHighSurrogate = codepoint;
337339 unicodeBufferPos = 0;
338340 state = STATE_UNICODE_SURROGATE;
@@ -348,9 +350,10 @@ void JsonStreamingParser::processUnicodeCharacter(char c) {
348350 // throw new ParsingError($this->_line_number,
349351 // $this->_char_number,
350352 // "Invalid low surrogate following Unicode high surrogate.");
353+ endUnicodeCharacter(codepoint);
351354 } else {
352355 endUnicodeCharacter(codepoint);
353- }
356+ }*/
354357 }
355358 }
356359boolean JsonStreamingParser::isHexCharacter (char c) {
@@ -390,6 +393,7 @@ void JsonStreamingParser::endUnicodeSurrogateInterstitial() {
390393 // "Expected '\\u' following a Unicode high surrogate. Got: " .
391394 // $unicode_escape);
392395 }
396+ unicodeBufferPos = 0 ;
393397 unicodeEscapeBufferPos = 0 ;
394398 state = STATE_UNICODE ;
395399 }
Original file line number Diff line number Diff line change @@ -65,10 +65,10 @@ class JsonStreamingParser {
6565 char buffer[BUFFER_MAX_LENGTH ];
6666 int bufferPos = 0 ;
6767
68- char unicodeEscapeBuffer[128 ];
68+ char unicodeEscapeBuffer[10 ];
6969 int unicodeEscapeBufferPos = 0 ;
7070
71- char unicodeBuffer[128 ];
71+ char unicodeBuffer[10 ];
7272 int unicodeBufferPos = 0 ;
7373
7474 int characterCounter = 0 ;
Original file line number Diff line number Diff line change 1010 "name" : " Daniel Eichhorn" ,
1111 "url" : " http://blog.squix.ch"
1212 },
13- "version" : " 1.0.3 " ,
13+ "version" : " 1.0.4 " ,
1414 "frameworks" : " arduino" ,
1515 "platforms" : " *" ,
1616 "examples" : [
Original file line number Diff line number Diff line change 11name =Json Streaming Parser
2- version =1.0.3
2+ version =1.0.4
33author =Daniel Eichhorn
44maintainer =Daniel Eichhorn <squix78@gmail.com>
55sentence =A very memory efficient library to parse (large) JSON objects on small devices
You can’t perform that action at this time.
0 commit comments