fix bad utf8 encodings by default (convert to u+FFFD)
this (temporarily, i hope) removes the fast path for handling strings internally without escaping or replacing bad utf8
This commit is contained in:
parent
7b05d0e1b7
commit
f137ff484b
6 changed files with 220 additions and 378 deletions
|
@ -78,7 +78,7 @@ err(Term, Opts) -> (jsx:parser(jsx, [], Opts))(Term).
|
|||
error_test_() ->
|
||||
[
|
||||
{"value error", ?_assertError(badarg, err(self(), []))},
|
||||
{"string error", ?_assertError(badarg, err(<<239, 191, 191>>, []))}
|
||||
{"string error", ?_assertError(badarg, err(<<239, 191, 191>>, [strict_utf8]))}
|
||||
].
|
||||
|
||||
custom_error_handler_test_() ->
|
||||
|
@ -90,7 +90,7 @@ custom_error_handler_test_() ->
|
|||
)},
|
||||
{"string error", ?_assertEqual(
|
||||
{string, [{string, <<239, 191, 191>>}]},
|
||||
err(<<239, 191, 191>>, [{error_handler, Error}])
|
||||
err(<<239, 191, 191>>, [{error_handler, Error}, strict_utf8])
|
||||
)}
|
||||
].
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue