Skip to content

[Bug] Buffer doesn't support usc-2, but Buffer.isEncoding supports that?! #21963

@ghost

Description

Nodejs:10.7.0
OS:Win 8.1 (SP1, x32)

If you use Buffer.isEncoding('usc-2'), this will return you true.

However, most of Buffer methods are NOT supporting this encoding. A typical example is (either of them will throw exceptions):

const c = new Buffer('aaa','usc-2');
const c = Buffer.from('aaa','usc-2');

Is there anything conflicting with the encoding type?

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