Skip to content

Commit dcc5822

Browse files
authored
chore: update GBK encoding table with corrected character mappings (#371)
1 parent 500da91 commit dcc5822

6 files changed

Lines changed: 69 additions & 7 deletions

File tree

.github/workflows/generator.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Update Encodings
2+
3+
on:
4+
workflow_dispatch:
5+
# schedule:
6+
# - cron: '0 8 * * *' # Uncomment this when it is in the master branch.
7+
8+
permissions:
9+
pull-requests: write
10+
contents: write
11+
12+
jobs:
13+
update-encodings:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v6
17+
18+
- name: Set up Node.js
19+
uses: actions/setup-node@v6
20+
21+
- name: Run scripts
22+
run: npm run generate
23+
24+
- name: Create Pull Request
25+
uses: gr2m/create-or-update-pull-request-action@v1
26+
env:
27+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28+
with:
29+
commit-message: 'chore: update encodings'
30+
title: 'chore: update encodings'
31+
body: >
32+
This auto-generated PR updates encodings to the latest version.
33+
34+
cc: @pillarjs/iconv-lite-collaborators
35+
branch: bot/update-encodings

encodings/tables/gbk-added.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818
["a640","",62],
1919
["a680","",32],
2020
["a6b9","",7],
21-
["a6d9","",6],
22-
["a6ec",""],
23-
["a6f3",""],
21+
["a6d9","︐︒︑︓︔︕︖"],
22+
["a6ec","︗︘"],
23+
["a6f3",""],
2424
["a6f6","",8],
2525
["a740","",62],
2626
["a780","",32],
@@ -50,7 +50,7 @@
5050
["fba1","",93],
5151
["fca1","",93],
5252
["fda1","",93],
53-
["fe50","⺁⺄㑳㑇⺈⺋㖞㘚㘎⺌⺗㥮㤘㧏㧟㩳㧐㭎㱮㳠⺧⺪䁖䅟⺮䌷⺳⺶⺷䎱䎬⺻䏝䓖䙡䙌"],
54-
["fe80","䜣䜩䝼䞍⻊䥇䥺䥽䦂䦃䦅䦆䦟䦛䦷䦶䲣䲟䲠䲡䱷䲢䴓",6,"䶮",93],
53+
["fe50","⺁⺄㑳㑇⺈⺋龴㖞㘚㘎⺌⺗㥮㤘龵㧏㧟㩳㧐龶龷㭎㱮㳠⺧龸⺪䁖䅟⺮䌷⺳⺶⺷䎱䎬⺻䏝䓖䙡䙌龹"],
54+
["fe80","䜣䜩䝼䞍⻊䥇䥺䥽䦂䦃䦅䦆䦟䦛䦷䦶龺䲣䲟䲠䲡䱷䲢䴓",6,"䶮龻",93],
5555
["8135f437",""]
5656
]

generation/gen-dbcs.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ async.parallel({
9999
}
100100

101101
// GB18030:2005 addition
102-
gbk2005add = [['8135f437', '']];
102+
var gbk2005add = [['8135f437', '']];
103103

104104
utils.writeTable("gbk-added", utils.generateTable(gbkadd).concat(gbk2005add));
105105

generation/package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
"name": "iconv-lite-generators",
33
"private": true,
44
"version": "1.0.0",
5+
"scripts": {
6+
"generate": "npm run generate:dbcs && npm run generate:sbcs",
7+
"generate:dbcs": "node gen-dbcs.js",
8+
"generate:sbcs": "node gen-sbcs.js"
9+
},
510
"devDependencies": {
611
"async": "^3.2.0",
712
"errto": "^0.2.1",

package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
"scripts": {
2929
"lint": "eslint",
3030
"lint:fix": "eslint --fix",
31+
"generate": "npm run generate --workspaces --if-present",
3132
"test": "mocha --reporter spec --check-leaks --grep .",
3233
"test:ci": "nyc --exclude test --reporter=lcovonly --reporter=text npm test",
3334
"test:cov": "nyc --exclude test --reporter=html --reporter=text npm test",
@@ -57,5 +58,8 @@
5758
"unorm": "^1.6.0",
5859
"typescript": "~5.9.3"
5960
},
60-
"dependencies": {}
61+
"dependencies": {},
62+
"workspaces": [
63+
"generation"
64+
]
6165
}

test/dbcs-test.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -501,6 +501,24 @@ var iconvCannotDecode = { // Characters that we can decode, but iconv cannot. En
501501
fe9d: "䴘",
502502
fe9e: "䴙",
503503
fe9f: "䶮",
504+
a6d9: "︐",
505+
a6da: "︒",
506+
a6db: "︑",
507+
a6dc: "︓",
508+
a6dd: "︔",
509+
a6de: "︕",
510+
a6df: "︖",
511+
a6ec: "︗",
512+
a6ed: "︘",
513+
a6f3: "︙",
514+
fe59: "龴",
515+
fe61: "龵",
516+
fe66: "龶",
517+
fe67: "龷",
518+
fe6d: "龸",
519+
fe7e: "龹",
520+
fe90: "龺",
521+
fea0: "龻",
504522

505523
// iconv and ICU are mapping "a3 a0" -> U+E5E5. However, WebKit/Chrome maps it to U+3000 noting compatibility with older websites.
506524
// Encoding Standard stands on the side of WebKit, so we are too.

0 commit comments

Comments
 (0)