microgateway
microgateway copied to clipboard
utf-8 string length for invoke
when i use chinese utf8 i get the wrong size convert string to buffer
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
.
@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.