node-json-socket icon indicating copy to clipboard operation
node-json-socket copied to clipboard

Bug fix for international character support

Open hpalz opened this issue 6 years ago • 4 comments

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:

hpalz avatar Apr 03 '18 19:04 hpalz

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?

hpalz avatar Apr 04 '18 19:04 hpalz

Added a new issue to support the PR: #47

hpalz avatar Apr 04 '18 19:04 hpalz

@hpalz + 1 I think it should be merged

foi avatar Jul 11 '18 11:07 foi

@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.

ken-okabe avatar Nov 16 '18 04:11 ken-okabe