You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The msg pack bin8 implementation does not follow the msg pack standard.
On the page msgpack-standard the bin8 format is flagged with 0xC4, however, in msgpack_detail.hpp, the bin8_cd which stores the bin8 format is initialized as 0xC7.
That flag belongs to a different format, ext8.
It seems that in the implementation the ext family of formats are used for the bin formats.
Because of this error any fields serialized using the bin family with another serializing library will not be decoded by the jsoncons msgpack implementation.
I have tested if changing the flags would work, and by placing the correct flags in the bin family formats in msgpack_detail.hpp the implementation now correctly decodes bin8 fields.
This also means that the ext family of formats is not supported yet.
For instance, the msg pack serialized byte array: 82 a4 74 65 73 74 20 a3 62 69 6e c4 08 00 01 02 03 04 05 06 07
Should be decoded as the following structure: {'test': 32, 'bin': b'\x00\x01\x02\x03\x04\x05\x06\x07'}
However, since the 0xC4 flag is not present in this msg pack implementation, the bin field is not decoded.
The text was updated successfully, but these errors were encountered:
Yes, it's a bug, thanks for reporting. Fixed on master. bin 8, 16 and 32 are now mapped correctly, and the mapping for the ext formats has been fixed.
For the ext formats, for ext types 0-127, we don't currently have any place in the API for the ext type, so when parsing only the payload is mapped, to byte string, same as bin. Currently there is no way to output ext formats with ext types 0-127.
For ext type -1, timestamp, timestamp 32 is mapped to uint64 (seconds) with semantic_tagtimestamp, and timestamps 64 and 96 are mapped to an array of two integers [seconds,nanoseconds] with semantic_tagtimestamp.
Hello,
The msg pack bin8 implementation does not follow the msg pack standard.
On the page msgpack-standard the bin8 format is flagged with 0xC4, however, in msgpack_detail.hpp, the bin8_cd which stores the bin8 format is initialized as 0xC7.
That flag belongs to a different format, ext8.
It seems that in the implementation the ext family of formats are used for the bin formats.
Because of this error any fields serialized using the bin family with another serializing library will not be decoded by the jsoncons msgpack implementation.
I have tested if changing the flags would work, and by placing the correct flags in the bin family formats in msgpack_detail.hpp the implementation now correctly decodes bin8 fields.
This also means that the ext family of formats is not supported yet.
For instance, the msg pack serialized byte array:
82 a4 74 65 73 74 20 a3 62 69 6e c4 08 00 01 02 03 04 05 06 07
Should be decoded as the following structure:
{'test': 32, 'bin': b'\x00\x01\x02\x03\x04\x05\x06\x07'}
However, since the 0xC4 flag is not present in this msg pack implementation, the bin field is not decoded.
The text was updated successfully, but these errors were encountered: