From 5808a1f3f23d19b53320ac97cb04af673cf14790 Mon Sep 17 00:00:00 2001 From: pluris Date: Wed, 13 Sep 2023 16:20:44 +0900 Subject: [PATCH] lib: update encoding sets in `WHATWG API` --- lib/internal/encoding.js | 4 ++-- test/parallel/test-whatwg-encoding-custom-internals.js | 4 ++-- ...st-whatwg-encoding-custom-textdecoder-api-invalid-label.js | 4 ++-- test/parallel/test-whatwg-encoding-custom-textdecoder.js | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/internal/encoding.js b/lib/internal/encoding.js index 9f88434b430978..a9bfb665c2f1e8 100644 --- a/lib/internal/encoding.js +++ b/lib/internal/encoding.js @@ -76,8 +76,8 @@ const empty = new Uint8Array(0); const encodings = new SafeMap([ ['unicode-1-1-utf-8', 'utf-8'], - ['unicode-11utf8', 'utf-8'], - ['unicode-20utf8', 'utf-8'], + ['unicode11utf8', 'utf-8'], + ['unicode20utf8', 'utf-8'], ['utf8', 'utf-8'], ['utf-8', 'utf-8'], ['x-unicode20utf8', 'utf-8'], diff --git a/test/parallel/test-whatwg-encoding-custom-internals.js b/test/parallel/test-whatwg-encoding-custom-internals.js index a3b92438c991df..505e623a681998 100644 --- a/test/parallel/test-whatwg-encoding-custom-internals.js +++ b/test/parallel/test-whatwg-encoding-custom-internals.js @@ -13,8 +13,8 @@ const { getEncodingFromLabel } = require('internal/encoding'); const mappings = { 'utf-8': [ 'unicode-1-1-utf-8', - 'unicode-11utf8', - 'unicode-20utf8', + 'unicode11utf8', + 'unicode20utf8', 'utf8', 'x-unicode20utf8', ], diff --git a/test/parallel/test-whatwg-encoding-custom-textdecoder-api-invalid-label.js b/test/parallel/test-whatwg-encoding-custom-textdecoder-api-invalid-label.js index 889c813454cf08..569c17baff4b6e 100644 --- a/test/parallel/test-whatwg-encoding-custom-textdecoder-api-invalid-label.js +++ b/test/parallel/test-whatwg-encoding-custom-textdecoder-api-invalid-label.js @@ -8,8 +8,8 @@ const assert = require('assert'); [ 'utf-8', 'unicode-1-1-utf-8', - 'unicode-11utf8', - 'unicode-20utf8', + 'unicode11utf8', + 'unicode20utf8', 'x-unicode20utf8', 'utf8', 'unicodefffe', diff --git a/test/parallel/test-whatwg-encoding-custom-textdecoder.js b/test/parallel/test-whatwg-encoding-custom-textdecoder.js index 890d1801f8c812..835c4d962d2ada 100644 --- a/test/parallel/test-whatwg-encoding-custom-textdecoder.js +++ b/test/parallel/test-whatwg-encoding-custom-textdecoder.js @@ -13,7 +13,7 @@ const util = require('util'); const buf = Buffer.from([0xef, 0xbb, 0xbf, 0x74, 0x65, 0x73, 0x74, 0xe2, 0x82, 0xac]); -const encoding_sets = ['unicode-1-1-utf-8', 'unicode-11utf8', 'unicode-20utf8', +const encoding_sets = ['unicode-1-1-utf-8', 'unicode11utf8', 'unicode20utf8', 'utf8', 'utf-8', 'x-unicode20utf8']; // Make Sure TextDecoder exist assert(TextDecoder);