msgpack-lite icon indicating copy to clipboard operation
msgpack-lite copied to clipboard

Discrepancy for binary keys between browser and nodejs

Open redhog opened this issue 2 years ago • 0 comments

If a map has keys that are not strings but bin format, in nodejs these are parsed as ascii text (or utf8?). However, in the browser these are first stored as a Int8Array, and then turned to strings using toString(), which makes e.g. the key "type" (ascii) look like "116,121,112,101". Either handling would be fine, but the inconsistency is a problem.

My test case is serializing using msgpack-numpy in python and then trying to deserialize using msgpack-lite (note: msgpack-numpy doesn't use an ext type but just produces a map object for some reason, and also uses bin format for the keys, instead of strings, again, for some "reason"...).

redhog avatar Jul 11 '23 07:07 redhog