Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

utf-8 string length for invoke #97

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

king729
Copy link

@king729 king729 commented Jan 10, 2018

when i use chinese utf8 i get the wrong size convert string to buffer

@tonyffrench
Copy link
Contributor

Can you say a little more about the use case and symptoms of the issue? Since new Buffer is deprecated it would be better to use Buffer.from.

@mathieudz
Copy link

@tonyffrench When the json payload contains non-ascii characters, the calculated length of the payload is wrong. It counts the number of characters instead of the number of bytes. The result is that the last characters of the payload are truncated, meaning invalid JSON. This is an important fix. I had the issue with accented latin characters.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants