Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Allow decoding raw strings #235

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

Merged
gfx merged 3 commits into msgpack:main from jasonpaulos:decode-raw-strings
Jan 26, 2025
Merged

Conversation

Copy link
Contributor

@jasonpaulos jasonpaulos commented Oct 30, 2023

This PR adds the ability to skip UTF-8 decoding of strings when you enable the rawStrings decoding option.

This is useful because I have encountered some encoded msgpack strings which do not contain valid UTF-8 data, and without a feature like this, it would be impossible to decode them properly.

According to the msgpack spec, this ability is encouraged:

  • String objects may contain invalid byte sequence and the behavior of a deserializer depends on the actual implementation when it received invalid byte sequence
    • Deserializers should provide functionality to get the original byte array so that applications can decide how to handle the object

Comment on lines +29 to +31
* Note that this option only applies to string values, not map keys. Additionally, when
* enabled, raw string length is limited by the maxBinLength option.
*/
Copy link

@jannotti jannotti Oct 30, 2023
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not do this for map keys as well?

Copy link
Contributor Author

@jasonpaulos jasonpaulos Oct 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This library doesn't support binary keys, so I decided to skip that case.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it doesn't. Sounds a good decision.

Copy link
Member

gfx commented Jan 26, 2025

Sorry for the delayed response. Thanks for your contribution. LGTM.

Copy link

codecov-commenter commented Jan 26, 2025
edited
Loading

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.07%. Comparing base (3783cf4) to head (3b6ef80).
Report is 25 commits behind head on main.

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

Additional details and impacted files
@@ Coverage Diff @@
## main #235 +/- ##
==========================================
- Coverage 98.55% 98.07% -0.48% 
==========================================
 Files 16 16 
 Lines 1037 1092 +55 
 Branches 200 249 +49 
==========================================
+ Hits 1022 1071 +49 
- Misses 15 21 +6 

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@gfx gfx merged commit 0bb101d into msgpack:main Jan 26, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers

@gfx gfx gfx approved these changes

+1 more reviewer

@jannotti jannotti jannotti left review comments

Reviewers whose approvals may not affect merge requirements
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /