Skip to content

Commit

Permalink
lib: remove usc-2 encoding
Browse files Browse the repository at this point in the history
Fixes: #21963
PR-URL: #21964
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
mscdex authored and targos committed Jul 31, 2018
1 parent 80b5c91 commit baf3027
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 9 deletions.
8 changes: 3 additions & 5 deletions benchmark/util/normalize-encoding.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,19 @@ const assert = require('assert');

const groupedInputs = {
group_common: ['undefined', 'utf8', 'utf-8', 'base64',
'binary', 'latin1', 'ucs-2', 'usc-2'],
'binary', 'latin1', 'ucs-2'],
group_upper: ['UTF-8', 'UTF8', 'UCS2', 'UTF-16LE',
'UTF16LE', 'BASE64', 'UCS-2', 'USC-2'],
'UTF16LE', 'BASE64', 'UCS-2'],
group_uncommon: ['foo', '1', 'false', 'undefined', '[]', '{}'],
group_misc: ['', 'utf16le', 'usc2', 'hex', 'HEX', 'BINARY']
group_misc: ['', 'utf16le', 'hex', 'HEX', 'BINARY']
};

const inputs = [
'',
'utf8', 'utf-8', 'UTF-8',
'UTF8', 'Utf8', 'uTf-8', 'utF-8',
'ucs2', 'UCS2', 'UcS2',
'USC2', 'usc2', 'uSc2',
'ucs-2', 'UCS-2', 'UcS-2',
'usc-2', 'USC-2', 'uSc-2',
'utf16le', 'utf-16le', 'UTF-16LE', 'UTF16LE',
'binary', 'BINARY', 'latin1', 'base64', 'BASE64',
'hex', 'HEX', 'foo', '1', 'false', 'undefined', '[]', '{}'];
Expand Down
1 change: 0 additions & 1 deletion lib/internal/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ function slowCases(enc) {
enc = `${enc}`.toLowerCase();
if (enc === 'utf-8') return 'utf8';
if (enc === 'ascii') return 'ascii';
if (enc === 'usc-2') return 'utf16le';
if (enc === 'ucs-2') return 'utf16le';
break;
case 6:
Expand Down
3 changes: 0 additions & 3 deletions test/parallel/test-internal-util-normalizeencoding.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ const tests = [
['utf-16le', 'utf16le'],
['UTF-16LE', 'utf16le'],
['UTF16LE', 'utf16le'],
['usc-2', 'utf16le'],
['USC-2', 'utf16le'],
['uSc-2', 'utf16le'],
['binary', 'latin1'],
['BINARY', 'latin1'],
['latin1', 'latin1'],
Expand Down

0 comments on commit baf3027

Please sign in to comment.