Closed
Description
var arr = [255, 216, 255, 224, 0, 16, 74, 70, 73, 70, 0, 1]
//length 12;
var buf1 = new Buffer(arr)
// length 12
var hex1 = buf1.toString('hex');
// length 24
var str = buf1.toString('utf8')
// length 12
var buf2 = new Buffer(str);
//length 20
var hex2 = buf2.toString('hex');
// length 40;
results for hex2
browserify - efbfbd00104a4649460001
node - efbfbdefbfbdefbfbdefbfbd00104a4649460001
the value of str in node is ����\u0000\u0010JFIF\u0000\u0001
which would suggest that the issue has to do with how new Buffer handles characters in text.