We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2e597de commit cf150ecCopy full SHA for cf150ec
lib/internal/encoding.js
@@ -430,7 +430,9 @@ function makeTextDecoderICU() {
430
431
#prepareConverter() {
432
if (this[kHandle] !== undefined) return;
433
- const handle = getConverter(this[kEncoding], this[kFlags]);
+ let icuEncoding = this[kEncoding];
434
+ if (icuEncoding === 'gbk') icuEncoding = 'gb18030'; // 10.1.1. GBK's decoder is gb18030's decoder
435
+ const handle = getConverter(icuEncoding, this[kFlags]);
436
if (handle === undefined)
437
throw new ERR_ENCODING_NOT_SUPPORTED(this[kEncoding]);
438
this[kHandle] = handle;
0 commit comments