node-json-socket
node-json-socket copied to clipboard
Bug fix for international character support
I ran into an issue with this library when parsing multiple messages with international characters. Since the messages are encoded using Buffer.byteLength, the substring in handleData fails (since byteLength will be greater than the actual substring length): https://github.com/sebastianseilund/node-json-socket/blob/master/lib/json-socket.js#L106
I am pushing 3 commits to demonstrate the issue and support the bug fix proposal.
Please let me know if you have any questions or concerns! :beers:
Not sure why the test failed for node v0.12. I tried it locally for that version and it worked fine. Is there a way to retest?
Added a new issue to support the PR: #47
@hpalz + 1 I think it should be merged
@hpalz Hi, Thanks a lot for your fix. I personally need a fixed version of NPM (using this library from TypeScript code seems that is the only adequate way without typing the whole code.)
So, I forked and published a fixed version to npm.
https://www.npmjs.com/package/json-socket-international
Regards.