Am 10.03.2014 13:52, schrieb Konstantin Burkalev:
> Hehey! It's me again :)
Hi Konstantin,
Did you push your changes to
https://github.com/KSDaemon/msgpack-js-browser
? Since I can't see new commits (last one is 9 months old ..)
> 3) While coding, i've found, that there is no support for big integers,
> probably because of there are no such methods in native browser DataView
Might be. JavaScript represents _all_ numbers a IEEE double internally
.. which limits the integer range that can be fully represented.
> object (see
https://developer.mozilla.org/en-US/docs/Web/API/DataView).
Yeah, also lacks UInt64 ..
you mean
https://github.com/jDataView/jDataView/wiki/64-bit-integers ??
> 4) Also there were some tests, i've updated them a little, not all, but
> acceptable for this time. You can open tests/index.html to see.
> (branch: int64support, not master)
> 5) Added jDataView as git submodule.
> 6) I've tried to use this brand new msgpack lib with wampy and
> AutobahnPython. As i can see, on decoding step, every time i am falling
> into bin8 case while trying to decode key name of wamp server features
> object, instead of string. (line 240 of msgpack.js). But in browser
> tests encoding/decoding goes well.
Probably easier to test "manually" (outside of AutobahnPython):
$ python
Python 2.7.6 (default, Nov 10 2013, 19:24:18) [MSC v.1500 32 bit
(Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import msgpack
>>> msgpack.packb("hello", use_bin_type = True)
'\xc4\x05hello'
>>> import binascii
>>> binascii.hexlify(msgpack.packb("hello", use_bin_type = True))
'c40568656c6c6f'
>>> binascii.hexlify(msgpack.packb({"a": "my", "b": "awesome", "c":
"dict", "d": 23}, use_bin_type = True))
'84c40161c4026d79c40163c40464696374c40162c407617765736f6d65c4016417'
>>>
Mmmh. And also:
>>> binascii.hexlify(msgpack.packb({"a": 23}, use_bin_type = True))
'81c4016117'
>>> binascii.hexlify(msgpack.packb({u"a": 23}, use_bin_type = True))
'81a16117'
>>> v1 = msgpack.packb({u"a": 23}, use_bin_type = True)
>>> msgpack.unpackb(v1, encoding = 'utf-8')
{u'a': 23}
>>> v2 = msgpack.packb({"a": 23}, use_bin_type = True)
>>> msgpack.unpackb(v2, encoding = 'utf-8')
{'a': 23}
>>> v1 == v2
False
>>>
the lower-case "u" before a string literal marks the literal as Unicode.
I am wondering if there is an issue with Unicode literals ..
Could you check if you can decode / roundtrip above?
https://github.com/tavendo/AutobahnPython/blob/master/autobahn/autobahn/wamp/serializer.py#L178
>
> The next steps are: try to research msgpack-python or try to use some
> other msgpack libs and somehow transport this binary data to browser to
> test it with msgpack-js-browser
>
>
>
> To be honest, I just "assumed" there would be at least one working
> library for a serialization format as widely used as MsgPack. Well,
> seems not so easy.
>
> Yeah, i thought so until, you know...
> That's it...
>