You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add an option to ignore UTF-8 encoding errors
By default Jiffy is quite strict in what it encodes. By default it will
not allow invalid UTF-8 to be produced. This can cause issues when
attempting to encode JSON that was decoded by other libraries as UTF-8
semantics are not uniformly enforced.
This patch adds an option 'force_utf8' to the encoder. If encoding hits
an error for an invalid string it will forcefully mutate the object to
contain only valid UTF-8 and return the resulting encoded JSON.
For the most part this means it will strip any garbage data from
binaries replacing it replacement codepoint U+FFFD. Although, it will
also try and the common error of encoding surrogate pairs as three-byte
sequences and reencode them into UTF-8 properly.
Update rebar and the Makefile
* Update rebar to a more recent version
* Update rebar.config for deprecation warnings
* Allow people to export the REBAR environment variable to use
their own version of rebar
* Fixed `make clean`
Fix segfaul when encoding with the uescape option
There was a bug that was resetting the extra amount of space needed when
encoding unicode characters with the `uescape` option enabled.
Fix uescapes for combining characters
I had a silly direction mistake in a bit shift that was causing the high
portion of all combining characters to be printed as \uD800 which is
obviously wrong. This bug only affects people using the non-default
uescape option during encoding.
Ensure that encoded doubles have a decimal point
Numbers like 1.0 were being encoded as <<"1">> which can lead to a bit
of confusion. This merely checks if a decimial point exists and if not
it appends ".0" to the value.
Fix uescape encoding bug
The encoding length for unicode values was applied to the wrong index
variable.
Thanks to Paul Guyot for the detailed bug report and fix.
Fixesdavisp#7