Skip to content

Commit e363378

Browse files
authored
Fix node encodings lookup in string parser
This fixes #582
1 parent e4e74b8 commit e363378

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

lib/parsers/string.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
var Iconv = require('iconv-lite');
22

3-
var NODE_ENCODING = [
4-
'ascii',
5-
'utf8',
6-
'utf16le',
7-
'ucs2',
8-
'base64',
9-
'latin1',
10-
'binary',
11-
'hex'
12-
];
3+
var NODE_ENCODING = {
4+
'ascii': true,
5+
'utf8': true,
6+
'utf16le': true,
7+
'ucs2': true,
8+
'base64': true,
9+
'latin1': true,
10+
'binary': true,
11+
'hex': true
12+
};
1313

1414
exports.decode = function(buffer, encoding, options) {
1515
if (NODE_ENCODING[encoding]) {

0 commit comments

Comments
 (0)