Skip to content

[buffer] fill() for utf16le is broken #9836

@trevnorris

Description

@trevnorris
  • Version: v6.9.1
  • Platform: Linux
  • Subsystem: buffer

Example of brokenness:

Buffer.allocUnsafeSlow(16).fill('a', 'utf16le').toString('utf16le')
// expect: 'aaaaaaaa'
// get:    '慡慡慡慡慡慡慡慡'

Seems to be treating the character as latin1.

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