-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
Closed
Labels
bufferIssues and PRs related to the buffer subsystem.Issues and PRs related to the buffer subsystem.docIssues and PRs related to the documentations.Issues and PRs related to the documentations.i18n-apiIssues and PRs related to the i18n implementation.Issues and PRs related to the i18n implementation.
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.
Metadata
Metadata
Assignees
Labels
bufferIssues and PRs related to the buffer subsystem.Issues and PRs related to the buffer subsystem.docIssues and PRs related to the documentations.Issues and PRs related to the documentations.i18n-apiIssues and PRs related to the i18n implementation.Issues and PRs related to the i18n implementation.