-
Notifications
You must be signed in to change notification settings - Fork 5
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
MessageWritter gone wrong will using special character likes é,à,â,ô... #360
Labels
bug
Something isn't working
Comments
Internal tracking ticket: FG-6352 |
Could you please provide a complete sample program that reproduces the issue? |
This sample reproduce the issue :
const writer = new MessageWriter(parse("string name"));
const reader = new MessageReader(parse("string name"));
const test = writer.writeMessage({ name: "béta" });
console.log("=== result === ", reader.readMessage(test));
this sample will print : Record {name: 'bét'}
Le jeu. 18 janv. 2024 à 18:36, Jacob Bandes-Storch ***@***.***>
a écrit :
… Could you please provide a complete sample program that reproduces the
issue?
—
Reply to this email directly, view it on GitHub
<#360 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AGPV4GBENMOBY7XLM6DWYYLYPFMQ3AVCNFSM6AAAAABCATJRCGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOJYHEZDMNRTGE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
This should fix it, please have a look: #361 |
Yes this fix it. Thanks a lot. |
jtbandes
added a commit
that referenced
this issue
Jan 22, 2024
### Public-Facing Changes Fixed a bug where non-ASCII strings would be truncated when `MessageWriter` encoded them as UTF-8. ### Description Fixes #360 `str.length` is the length of the string in UTF-16. However, we use TextEncoder to encode strings as UTF-8. We could compute the length using TextEncoder itself, but this proves to be much slower than a manual calculation: https://jsbench.me/nzlrkwmeiq/1
Fixed in v2.0.3. Thanks for the report! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
While i'll try to serialize my object using new MessageWritter().writeMessage(myRequest), myRequest containing an object with a key name:string of value 'béta' the serialization modify my string to 'bét', it remove one character per special character .
example :
'béta' ==> 'bét'
'bééta' ==> 'bé'
'béééta' ==>'b'
Steps To Reproduce
call the function MessageWriter().writeMessage({name:'béta'}) store it in a const
then use MessageReader().readMessage(myConst) you'll have a string containing 'bét'
here is a sample to reproduce the issue :
this sample will print : Record {name: 'bét'}
Expected Behavior
The text was updated successfully, but these errors were encountered: