sile / jsone

Erlang JSON library
MIT License
291 stars 71 forks source link

Add `disallow_invalid_utf8` option for decoding #44

Closed sile closed 5 years ago

sile commented 5 years ago

This PR adds reject_invalid_utf8 option. By setting the option with the value false when decoding, you can reject JSON strings that contain invalid UTF-8 byte sequences. See also: https://github.com/sile/jsone/issues/37

codecov-io commented 5 years ago

Codecov Report

Merging #44 into master will decrease coverage by 0.01%. The diff coverage is 66.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #44      +/-   ##
==========================================
- Coverage   88.38%   88.37%   -0.02%     
==========================================
  Files           3        3              
  Lines         267      344      +77     
==========================================
+ Hits          236      304      +68     
- Misses         31       40       +9
Impacted Files Coverage Δ
src/jsone.erl 38.46% <ø> (+9.89%) :arrow_up:
src/jsone_decode.erl 98.34% <66.66%> (-0.81%) :arrow_down:
src/jsone_encode.erl 88.83% <0%> (+3.64%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update da850bd...0b9dc77. Read the comment docs.