Skip to content
This repository has been archived by the owner on Jun 28, 2021. It is now read-only.

Use StringDecoder for converting Buffers toString #43

Closed
wants to merge 1 commit into from
Closed

Use StringDecoder for converting Buffers toString #43

wants to merge 1 commit into from

Conversation

ajafff
Copy link

@ajafff ajafff commented Apr 15, 2015

When a unicode character spreads across 2 Buffers, buffer.toString() will yield the wrong result. You get one (or more) unprintable character at the end of the first and the beginning of the second Buffer.
StringDecoder buffers the bytes of the uncomplete unicode character and outputs it with the next Buffer.
see also http://stackoverflow.com/questions/12121775/convert-streamed-buffers-to-utf8-string

When a unicode character spreads across 2 Buffers, buffer.toString() will yield the wrong result. You get one (or more) unprintable character at the end of the first and the beginning of the second Buffer.
StringDecoder buffers the bytes of the uncomplete unicode character and outputs it with the next Buffer.
see also http://stackoverflow.com/questions/12121775/convert-streamed-buffers-to-utf8-string
@wdavidw wdavidw closed this in 3aff096 Apr 17, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant