Details
-
Bug
-
Resolution: Fixed
-
Major
-
3.0
-
Security Level: Public
-
None
-
2
Description
If the Result contains illegal UTF-8 characters, the conversion from UTF-8 to UTF-16 in NativeFLEncoder_finishJSON will fail and return null and, thus, toJSON will return null.
I believe that the correct solution to this is that toJSON (and, by extension Array and Dictionary) should throw exception on failure. This would be an API change.
Currently these functions wrap the LiteCoreException thrown by LiteCore in an unchecked IllegalStateException.