File tree Expand file tree Collapse file tree 4 files changed +10
-6
lines changed Expand file tree Collapse file tree 4 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -332,7 +332,9 @@ void JsonStreamingParser::processUnicodeCharacter(char c) {
332
332
333
333
if (unicodeBufferPos == 4 ) {
334
334
int codepoint = getHexArrayAsDecimal (unicodeBuffer, unicodeBufferPos);
335
- if (codepoint >= 0xD800 && codepoint < 0xDC00 ) {
335
+ endUnicodeCharacter (codepoint);
336
+ return ;
337
+ /* if (codepoint >= 0xD800 && codepoint < 0xDC00) {
336
338
unicodeHighSurrogate = codepoint;
337
339
unicodeBufferPos = 0;
338
340
state = STATE_UNICODE_SURROGATE;
@@ -348,9 +350,10 @@ void JsonStreamingParser::processUnicodeCharacter(char c) {
348
350
// throw new ParsingError($this->_line_number,
349
351
// $this->_char_number,
350
352
// "Invalid low surrogate following Unicode high surrogate.");
353
+ endUnicodeCharacter(codepoint);
351
354
} else {
352
355
endUnicodeCharacter(codepoint);
353
- }
356
+ }*/
354
357
}
355
358
}
356
359
boolean JsonStreamingParser::isHexCharacter (char c) {
@@ -390,6 +393,7 @@ void JsonStreamingParser::endUnicodeSurrogateInterstitial() {
390
393
// "Expected '\\u' following a Unicode high surrogate. Got: " .
391
394
// $unicode_escape);
392
395
}
396
+ unicodeBufferPos = 0 ;
393
397
unicodeEscapeBufferPos = 0 ;
394
398
state = STATE_UNICODE;
395
399
}
Original file line number Diff line number Diff line change @@ -65,10 +65,10 @@ class JsonStreamingParser {
65
65
char buffer[BUFFER_MAX_LENGTH];
66
66
int bufferPos = 0 ;
67
67
68
- char unicodeEscapeBuffer[128 ];
68
+ char unicodeEscapeBuffer[10 ];
69
69
int unicodeEscapeBufferPos = 0 ;
70
70
71
- char unicodeBuffer[128 ];
71
+ char unicodeBuffer[10 ];
72
72
int unicodeBufferPos = 0 ;
73
73
74
74
int characterCounter = 0 ;
Original file line number Diff line number Diff line change 10
10
"name" : " Daniel Eichhorn" ,
11
11
"url" : " http://blog.squix.ch"
12
12
},
13
- "version" : " 1.0.3 " ,
13
+ "version" : " 1.0.4 " ,
14
14
"frameworks" : " arduino" ,
15
15
"platforms" : " *" ,
16
16
"examples" : [
Original file line number Diff line number Diff line change 1
1
name =Json Streaming Parser
2
- version =1.0.3
2
+ version =1.0.4
3
3
author =Daniel Eichhorn
4
4
maintainer =Daniel Eichhorn <
[email protected] >
5
5
sentence =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