mirror of https://gitee.com/openkylin/nodejs.git
16 lines
330 B
JavaScript
16 lines
330 B
JavaScript
'use strict';
|
|
|
|
require('../common');
|
|
const assert = require('assert');
|
|
const { Readable } = require('stream');
|
|
|
|
|
|
{
|
|
const readable = new Readable({ encoding: 'hex' });
|
|
assert.strictEqual(readable._readableState.encoding, 'hex');
|
|
|
|
readable.setEncoding(null);
|
|
|
|
assert.strictEqual(readable._readableState.encoding, 'utf8');
|
|
}
|