Skip to content

Commit 8156738

Browse files
ChALkeRRafaelGSS
authored andcommitted
lib: gbk decoder is gb18030 decoder per spec
PR-URL: #61099 Refs: https://encoding.spec.whatwg.org/#gbk-decoder Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
1 parent 9ec35c0 commit 8156738

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎lib/internal/encoding.js‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,9 @@ function makeTextDecoderICU() {
431431

432432
#prepareConverter(){
433433
if(this[kHandle]!==undefined)return;
434-
consthandle=getConverter(this[kEncoding],this[kFlags]);
434+
leticuEncoding=this[kEncoding];
435+
if(icuEncoding==='gbk')icuEncoding='gb18030';// 10.1.1. GBK's decoder is gb18030's decoder
436+
consthandle=getConverter(icuEncoding,this[kFlags]);
435437
if(handle===undefined)
436438
thrownewERR_ENCODING_NOT_SUPPORTED(this[kEncoding]);
437439
this[kHandle]=handle;

0 commit comments

Comments
 (0)