Skip to content

Tags: karelwar/jiffy

Tags

0.4.4

Toggle 0.4.4's commit message
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.

0.4.3

Toggle 0.4.3's commit message
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`

0.4.2

Toggle 0.4.2's commit message
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.

0.4.1

Toggle 0.4.1's commit message
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.

0.4.0

Toggle 0.4.0's commit message
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.

0.3.0

Toggle 0.3.0's commit message
Allow iolists to be passed directly to decode/1

Fixes davisp#15

0.2.0

Toggle 0.2.0's commit message
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.

Fixes davisp#7

0.1.0

Toggle 0.1.0's commit message
Use git version info.