Subject: | broken interoperability |
Date: | Tue, 16 Feb 2016 11:57:52 +0300 |
To: | bug-Data-MessagePack [...] rt.cpan.org |
From: | Anthony Pankov <ap00 [...] mail.ru> |
Fixed string more than 31 characters length packed with php modules (pecl-msgpack,
rybakit/msgpack) can not be unpacked with Data::MessagePack (parse
error).
It seems that PHP modules pack string >31 prefixed by 0xd9 while
Data::MessagePack prefix is 0xda.
Pack data by Data::MessagePack:
$p=Data::MessagePack->pack('AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA');
print encode("ascii", $p, Encode::FB_PERLQQ)
\x{00da}iAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
Data packed by PHP modules (user_agent is the problem: field of
32 character length):
\x{0082}\x{00a8}httpinfo\x{0083}\x{00ab}remote_addr\x{00a9}127.0.0.1\x{00aa}proxy_desc\x{0081}\x{00b4}HTTP_X_FORWARDED_FOR\x{0091}\x{00ae}11.290.121.202\x{00aa}user_agent\x{00d9}
Mozilla/5.0 (Windows NT 6.1; WOW\x{00a5}ainfo\x{0081}\x{00a3}uid\x{00a3}ant
The same Base64-coded:
gqhodHRwaW5mb4OrcmVtb3RlX2FkZHKpMTI3LjAuMC4xqnByb3h5X2Rlc2OBtEhUVFBfWF9GT1JXQVJERURfRk9Ska45MS4xOTAuMTIxLjIwMqp1c2VyX2FnZW502SBNb3ppbGxhLzUuMCAoV2luZG93cyBOVCA2LjE7IFdPV6VhaW5mb4GjdWlko2FudA==
--
Best regards,
Anthony Pankov