New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement support for \uxxxx escape sequences. Fixes #304 #791
Conversation
Hi @trilader, Thank you very much for this Pull Request. The important thing concerning issue #304 is the code size. With this PR, you only added 224 bytes on ATmega328. On the one hand, I don't like the idea of increasing the size by 8% for only 0.001% of the user. Anyway, we first need to be sure that this code works. Also, please send a link (or two) to the documentation that you used as a reference, so I can double check. Thanks. Regards, |
This saves 34 bytes in JsonParserExample on ATMega328
This saves 18 bytes in JsonParserExample on ATMega328
This saves 10 bytes in JsonParserExample on ATMega328
I've updated the code and managed to decrease the size impact by about 27% (62 bytes, tested with the JsonParserExample for Arduino Uno) Regarding the references used: The code only produces proper UTF-8 for codepoints < 0x10000, codepoints above that would be encoded as two escapes in JSON using surrogate UTF-16 code units. In this case the implementation will produce CESU-8. |
Hi @trilader, When I compare the master branch to this one, there is a 182 bytes increase in the size of It's still very good and it's a significant improvement compared to the first version. I've been thinking about this issue, and I think the solution to provide this new feature without risking to break existing code would be to make it optional. Anyway, thank you for this amazing job. Regards, |
Hi Daniel, I manually integrated the changes in 7050ef6. Thank you very much for your work, and please apologize for the long delay. Regards, |
Currently there are no unit tests for this, as I've got no idea which file would be appropriate for this kind of test case.