-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
CBOR string #757
Comments
This is currently not supported, as we only support UTF-8 as encoding. I we would accept byte strings, we would also need to support additional encodings. While this would just be a programming exercise (it seems that only base64url, base64, base16, and CBOR are mentioned in RFC 7049), it is currently not a priority for this library. However, PRs are always welcome :-) |
ATM, it's possible to misuse the const std::string binary = load_some_binary_like_a_jpeg_file();
json src = {"data", binary};
const auto bin_serialization = json::to_cbor(src); // json::to_msgpack()
auto dest = json::from_cbor(bin_serialization); // json::from_msgpack()
// now: dest["data"].get<std::string>() == binary
// if: serialization/deserialization by this library it may sound weird, but as long as all modern |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Binary strings are now there, see #1662. |
I received some CBOR files that contain strings (major type 2) and not UTF-8 strings(major type 3).
It looks like parsing fails. Is it on purpose?
The text was updated successfully, but these errors were encountered: