{"action":"closed","issue":{"url":"https://api.github.com/repos/msgpack/msgpack-erlang/issues/59","repository_url":"https://api.github.com/repos/msgpack/msgpack-erlang","labels_url":"https://api.github.com/repos/msgpack/msgpack-erlang/issues/59/labels{/name}","comments_url":"https://api.github.com/repos/msgpack/msgpack-erlang/issues/59/comments","events_url":"https://api.github.com/repos/msgpack/msgpack-erlang/issues/59/events","html_url":"https://github.com/msgpack/msgpack-erlang/issues/59","id":133078740,"number":59,"title":"Incompatible with str value encoded with umsgpack in Python","user":{"login":"gmr","id":49469,"avatar_url":"https://avatars.githubusercontent.com/u/49469?v=3","gravatar_id":"","url":"https://api.github.com/users/gmr","html_url":"https://github.com/gmr","followers_url":"https://api.github.com/users/gmr/followers","following_url":"https://api.github.com/users/gmr/following{/other_user}","gists_url":"https://api.github.com/users/gmr/gists{/gist_id}","starred_url":"https://api.github.com/users/gmr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gmr/subscriptions","organizations_url":"https://api.github.com/users/gmr/orgs","repos_url":"https://api.github.com/users/gmr/repos","events_url":"https://api.github.com/users/gmr/events{/privacy}","received_events_url":"https://api.github.com/users/gmr/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-02-11T20:19:59Z","updated_at":"2016-02-19T21:37:36Z","closed_at":"2016-02-19T21:37:36Z","body":"Moving our Python apps to umsgpack from msgpack-python, we're running an issue where msgpack-erlang does not understand the format being used. It appears that umsgpack tries to be more efficient in packing the data and uses str 8 instead of str 16 for values that fit in it.\r\n\r\nIt my initial surface level investigation, I believe that msgpack-erlang may not be implementing str 8 correctly, but I've not vetted this yet with values encoded from another library other than umsgpack.\r\n\r\nExample:\r\n\r\n```erlang\r\nErlang/OTP 17 [erts-6.4] [source] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] [dtrace]\r\n\r\nEshell V6.4  (abort with ^G)\r\n1> %% str 16\r\n1> A = <<132,164,116,121,112,101,167,97,99,99,111,117,110,116,165,118,97,108,117,101,\r\n1>   206,0,13,242,94,162,105,100,218,0,36,56,102,52,51,101,57,50,100,45,48,101,49,\r\n1>   100,45,52,100,48,56,45,98,57,102,99,45,56,99,97,98,57,97,98,100,56,99,97,100,\r\n1>   170,99,114,101,97,116,101,100,95,97,116,218,0,32,50,48,49,53,45,48,57,45,49,\r\n1>   56,84,49,53,58,50,56,58,53,55,46,53,52,50,51,49,56,43,48,48,58,48,48>>.\r\n<<132,164,116,121,112,101,167,97,99,99,111,117,110,116,\r\n  165,118,97,108,117,101,206,0,13,242,94,162,105,100,218,\r\n  ...>>\r\n2> msgpack:unpack(A).\r\n{ok,#{<<\"created_at\">> => <<\"2015-09-18T15:28:57.542318+00:00\">>,\r\n      <<\"id\">> => <<\"8f43e92d-0e1d-4d08-b9fc-8cab9abd8cad\">>,\r\n      <<\"type\">> => <<\"account\">>,\r\n      <<\"value\">> => 914014}}\r\n3> \r\n3> %% str 8 \r\n3> B = <<132,164,116,121,112,101,167,97,99,99,111,117,110,116,165,118,97,108,117,101,\r\n3>   206,0,13,242,94,162,105,100,217,36,56,102,52,51,101,57,50,100,45,48,101,49,\r\n3>   100,45,52,100,48,56,45,98,57,102,99,45,56,99,97,98,57,97,98,100,56,99,97,100,\r\n3>   170,99,114,101,97,116,101,100,95,97,116,217,32,50,48,49,53,45,48,57,45,49,56,\r\n3>   84,49,53,58,50,56,58,53,55,46,53,52,50,51,49,56,43,48,48,58,48,48>>.\r\n<<132,164,116,121,112,101,167,97,99,99,111,117,110,116,\r\n  165,118,97,108,117,101,206,0,13,242,94,162,105,100,217,\r\n  ...>>\r\n4> msgpack:unpack(B).\r\n{error,incomplete}\r\n```\r\n\r\nAnd in Python with the str 8 values:\r\n\r\n```python\r\nPython 3.5.1 (default, Dec  8 2015, 12:40:26) \r\n[GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.1.76)] on darwin\r\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\r\n>>> import msgpack\r\n>>> import umsgpack\r\n>>> a = b'\\x84\\xa4type\\xa7account\\xa5value\\xce\\x00\\r\\xf2^\\xa2id\\xd9$8f43e92d-0e1d-4d08-b9fc-8cab9abd8cad\\xaacreated_at\\xd9 2015-09-18T15:28:57.542318+00:00'\r\n>>> msgpack.unpackb(a)\r\n{b'id': b'8f43e92d-0e1d-4d08-b9fc-8cab9abd8cad', b'type': b'account', b'value': 914014, b'created_at': b'2015-09-18T15:28:57.542318+00:00'}\r\n>>> umsgpack.unpackb(a)\r\n{'id': '8f43e92d-0e1d-4d08-b9fc-8cab9abd8cad', 'type': 'account', 'value': 914014, 'created_at': '2015-09-18T15:28:57.542318+00:00'}\r\n```\r\n\r\nDoes this appear to be the case to you?\r\n\r\n\r\n"}}