Skip to content

Commit

Permalink
Merge f7ddb67 into 4203bba
Browse files Browse the repository at this point in the history
  • Loading branch information
dougwilson committed Feb 21, 2023
2 parents 4203bba + f7ddb67 commit b791f84
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 17 deletions.
16 changes: 0 additions & 16 deletions .github/workflows/ci.yml
Expand Up @@ -10,7 +10,6 @@ jobs:
strategy:
matrix:
name:
- Node.js 0.8
- Node.js 0.10
- Node.js 0.12
- io.js 1.x
Expand All @@ -35,11 +34,6 @@ jobs:
- Node.js 19.x

include:
- name: Node.js 0.8
node-version: "0.8"
npm-i: mocha@2.5.3
npm-rm: nyc

- name: Node.js 0.10
node-version: "0.10"
npm-i: mocha@2.5.3 nyc@10.3.2
Expand Down Expand Up @@ -129,12 +123,6 @@ jobs:
shell: bash -eo pipefail -l {0}
run: |
nvm install --default ${{ matrix.node-version }}
if [[ "${{ matrix.node-version }}" == 0.* && "$(cut -d. -f2 <<< "${{ matrix.node-version }}")" -lt 10 ]]; then
nvm install --alias=npm 0.10
nvm use ${{ matrix.node-version }}
sed -i '1s;^.*$;'"$(printf '#!%q' "$(nvm which npm)")"';' "$(readlink -f "$(which npm)")"
npm config set strict-ssl false
fi
dirname "$(nvm which ${{ matrix.node-version }})" >> "$GITHUB_PATH"
- name: Configure npm
Expand All @@ -145,10 +133,6 @@ jobs:
npm config set shrinkwrap false
fi
- name: Remove npm module(s) ${{ matrix.npm-rm }}
run: npm rm --silent --save-dev ${{ matrix.npm-rm }}
if: matrix.npm-rm != ''

- name: Install npm module(s) ${{ matrix.npm-i }}
run: npm install --save-dev ${{ matrix.npm-i }}
if: matrix.npm-i != ''
Expand Down
8 changes: 8 additions & 0 deletions HISTORY.md
@@ -1,3 +1,11 @@
3.x
===

* 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
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
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

0 comments on commit b791f84

Please sign in to comment.