Skip to content

Converting String-object to Buffer fails to copy data #13652

@mvduin

Description

@mvduin
  • Version: v8.1.0

Creating a buffer from a String object results in a zero-filled buffer (of length equal to the string length in UTF-16 code-units):

> Buffer.from(new String("Hello world"))
<Buffer 00 00 00 00 00 00 00 00 00 00 00>
> Buffer.from(new String("\u{1F4A9}"))
<Buffer 00 00>

Metadata

Metadata

Assignees

No one assigned

    Labels

    bufferIssues and PRs related to the buffer subsystem.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions