Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix jsone:try_encode({{json_utf8, IncompleteUtf8}}) raises a try_clause exception. #81

Merged
merged 3 commits into from
Sep 21, 2023

Conversation

sile
Copy link
Owner

@sile sile commented Sep 21, 2023

{{jsone_utf8, _}} feature was introduced in #11, but it turned out that the current implementation doesn't consider that unicode:characters_to_binary/1 could return {incomplete, _, _} tuple as the result.
If the tuple is returned, try_encode() method raises an (unintended) exception.
This PR fixes this problem.

@sile sile changed the title Fix jsone:try_encode({{json_utf8, IncompleteUtf8}}) raises an try_clause exception. Fix jsone:try_encode({{json_utf8, IncompleteUtf8}}) raises a try_clause exception. Sep 21, 2023
@codecov-commenter
Copy link

codecov-commenter commented Sep 21, 2023

Codecov Report

Merging #81 (caec6ba) into master (8250f55) will increase coverage by 0.32%.
The diff coverage is 100.00%.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

@@            Coverage Diff             @@
##           master      #81      +/-   ##
==========================================
+ Coverage   91.91%   92.23%   +0.32%     
==========================================
  Files           4        4              
  Lines         334      335       +1     
==========================================
+ Hits          307      309       +2     
+ Misses         27       26       -1     
Files Changed Coverage Δ
src/jsone_encode.erl 87.17% <100.00%> (+0.72%) ⬆️

@sile sile merged commit edff49e into master Sep 21, 2023
4 checks passed
@sile sile deleted the fix-json-utf8-encoding-bug branch September 21, 2023 05:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants