Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: bump iconv-lite to 0.5 #67

Merged
merged 1 commit into from
Feb 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
===

* Drop support for Node.js 0.8
* deps: iconv-lite@0.5.2
- Add encoding cp720
- Add encoding UTF-32

2.5.2 / 2023-02-21
==================
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"dependencies": {
"bytes": "3.1.2",
"http-errors": "2.0.0",
"iconv-lite": "0.4.24",
"iconv-lite": "0.5.2",
"unpipe": "1.0.0"
},
"devDependencies": {
Expand Down
22 changes: 22 additions & 0 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,28 @@ describe('Raw Body', function () {
})
})

it('should decode UTF-32 string (LE BOM)', function (done) {
// BOM makes this LE
var stream = createStream(Buffer.from('fffe0000bf00000043000000f30000006d0000006f00000020000000650000007300000074000000e1000000730000003f000000', 'hex'))
var string = '¿Cómo estás?'
getRawBody(stream, 'utf-32', function (err, str) {
assert.ifError(err)
assert.strictEqual(str, string)
done()
})
})

it('should decode UTF-32 string (BE BOM)', function (done) {
// BOM makes this BE
var stream = createStream(Buffer.from('0000feff000000bf00000043000000f30000006d0000006f00000020000000650000007300000074000000e1000000730000003f', 'hex'))
var string = '¿Cómo estás?'
getRawBody(stream, 'utf-32', function (err, str) {
assert.ifError(err)
assert.strictEqual(str, string)
done()
})
})

it('should correctly calculate the expected length', function (done) {
var stream = createStream(Buffer.from('{"test":"å"}'))

Expand Down