Skip to content

MessageBuffer.append: length of string in bytes#163

Merged
dbaeumer merged 1 commit intomicrosoft:masterfrom
openlawlibrary:master
Feb 17, 2017
Merged

MessageBuffer.append: length of string in bytes#163
dbaeumer merged 1 commit intomicrosoft:masterfrom
openlawlibrary:master

Conversation

@dgreisen
Copy link
Contributor

messageBuffer.append creates a buffer based on the length of the string to be written to it. str.length does not return the correct length of the string in bytes when the string contains multi-byte unicode characters. Buffer.byteLength does return the proper length, so switched to this method.

messageBuffer.append creates a buffer based on the length of the string to be written to it. `str.length` does not return the correct length of the string in bytes when the string contains multi-byte unicode characters. Buffer.byteLength does return the proper length, so switched to this method.
@msftclas
Copy link

Hi @dgreisen, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution!

This seems like a small (but important) contribution, so no Contribution License Agreement is required at this point. Real humans will now evaluate your PR.

TTYL, MSBOT;

1 similar comment
@msftclas
Copy link

Hi @dgreisen, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution!

This seems like a small (but important) contribution, so no Contribution License Agreement is required at this point. Real humans will now evaluate your PR.

TTYL, MSBOT;

@dbaeumer
Copy link
Member

Good catch.

@dbaeumer dbaeumer merged commit fc1a79d into microsoft:master Feb 17, 2017
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