-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
Closed
Labels
string_decoderIssues and PRs related to the string_decoder subsystem.Issues and PRs related to the string_decoder subsystem.
Description
- Version: 8 and above (but fixing might be semver-major)
- Subsystem: string_decoder
'use strict';
const { StringDecoder } = require('string_decoder');
const bufs = [
Buffer.from('f6', 'hex'),
Buffer.from('9b', 'hex'),
Buffer.from('d1', 'hex')
];
const sd = new StringDecoder('utf8');
let str = '';
for (const buf of bufs)
str += sd.write(buf);
str += sd.end();
console.log(`str = ${str}`) // 2 replacement chars
console.log(`orig = ${Buffer.concat(bufs).toString()}`) // 3 replacement charsHaven’t really looked into this yet, so anybody who’d like to can feel free to do so.
Metadata
Metadata
Assignees
Labels
string_decoderIssues and PRs related to the string_decoder subsystem.Issues and PRs related to the string_decoder subsystem.