squix78 / json-streaming-parser

Arduino library for parsing potentially huge json streams on devices with scarce memory
MIT License
205 stars 88 forks source link

Support for 8-bit ASCII and unescaped UTF8 characters #28

Open dbnski opened 4 years ago

dbnski commented 4 years ago

The original code uses signed char type for variables that hold the character being processed. It breaks 8-bit ASCII characters used in many European languages, but also prevents the library from correctly handling unescaped UTF8 characters. The attached patch addresses both these problems and further improves support for UTF8-encoded strings. I am aware that updating all methods wasn't necessary to make this work, but I thought perhaps it was a good idea to still do so for consistency.

dbnski commented 4 years ago

It was just something quick I put together while trying to use your library in a PoC, but I see it needs some polishing to be able to pass through tests. If you are interested in merging this patch, I can update the PR when I have some spare time.