T
T
theaidem2014-09-07 20:08:58
JavaScript
theaidem, 2014-09-07 20:08:58

How to decode Cyrillic from bson, msgpack via js?

Hello, I'm stupid, but I just can't get the correct decoding of the Cyrillic alphabet from bson, msgpack
Gives out all sorts of crap, for example:

...
buffer = msgpack.encode("Русь!");
decoded = msgpack.decode(buffer);
console.log(decoded); //выдает: " CAL!"
...

This lib is used: https://github.com/creationix/msgpack-js-browser
With BSON the same trouble: https://github.com/mongodb/js-bson
The topic was raised here https://github.com/mongodb /js-bson/issues/42 but changing the charset does not lead to the correct result.
wtf?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Power, 2014-09-12
@theaidem

Here's the fix: https://github.com/Powerrr/msgpack-js-browser/comm... .
But the msgpack-js-browser project looks abandoned, so I think it's better to find something else.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question