-
Notifications
You must be signed in to change notification settings - Fork 7
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
ObjectStr Text
is incompatible with pre-2.0 MessagePack spec
#36
Comments
By "pre-2.0", do you mean it is compatible with the post-2.0 spec? Text accepts arbitrary Unicode code points, which includes all code points from 0 to 255. We could use that to encode arbitrary bytes. This is what we do in JSON::XS (and JSON::PP) for Perl. |
It is compatible, except that 2.0 tells the ObjectStr is UTF-8, while it wasn't limited earlier. Well, now i observe parsing failures with unmodified msgpack-binary and msgpack-types when reading arbitrary bytes in the strings:
actual:
|
One option would be to use a Another option would be to say that this library only supports MessagePack >= 2.0 and, honestly, I think this one makes the most sense. |
Possibly, the unused config could be extended to support safe utf8 decoding. A separate issue? |
Yes the config makes sense to be used for that. I'm mostly in favour of supporting only 2.0 (and higher if any higher happens). How would you suggest the semantics to be for safe utf8? |
I don't think you can supply any configuration to a Currently i went the former way: |
+1 |
As the spec allows non-unicode content, while
Text
can't accept arbitrary bytes.What would be a good way to augment msgpack-types to avoid forking the library or breaking code compatibility by s/Text/ByteString/? Python's msgpack library uses
use_bin_type
andraw
options to handle the old format, but i don't see how to do similar stuff in Haskell.The text was updated successfully, but these errors were encountered: