While JSON values are assumed to be UTF-8–encoded, there are some exposed functions that can be provided non–UTF-8–encoded inputs, such as the _Key implementations for ByteStrings. Just in case a user provides inputs to these functions that are not non–UTF-8–encoded, this patch replaces the use of decodeUtf8 with decodeUtf8With lenientDecode. That way, rather than having these inputs crash the program, the offending characters will simply be replaced with Unicode replacement characters.
While JSON values are assumed to be UTF-8–encoded, there are some exposed functions that can be provided non–UTF-8–encoded inputs, such as the
_Key
implementations forByteString
s. Just in case a user provides inputs to these functions that are not non–UTF-8–encoded, this patch replaces the use ofdecodeUtf8
withdecodeUtf8With lenientDecode
. That way, rather than having these inputs crash the program, the offending characters will simply be replaced with Unicode replacement characters.Fixes #48.