-
Notifications
You must be signed in to change notification settings - Fork 39
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
Problem about message missing when write CJK string #139
Comments
Good catch! @mcollina I don't see a good way to fix this without some form of perf regression. I think we have 2 options: In write we:
|
This module's readme clearly states it is a utf8 only stream module. |
All strings in javascript are utf-16... |
So they are https://262.ecma-international.org/11.0/#sec-ecmascript-language-types-string-type |
That's unlikely to happen in the short term. I'd be happy to see a PR that fixes it (without regressing the throughput). |
Here is a PR with a partial fix: #154 |
The next step would be to convert |
For whomever tackles this by swapping out the |
The problem is about line below
sonic-boom/index.js
Lines 164 to 165 in 7b4e25f
n
is the byte length ofthis._writingBuf
, but it may not equals the characters length of the string which actually encoded in utf16. Sothis._len
would be less than zero. It will lead to message missing.The text was updated successfully, but these errors were encountered: