version bump 1.12.0: infrastructure

This commit is contained in:
SheetJS 2018-01-18 17:47:47 -05:00
parent b070fe0052
commit 0ada6f6c75
63 changed files with 675 additions and 261 deletions

View File

@ -5,14 +5,14 @@
"ecmaVersion": 3,
},
"plugins": [ "html", "json" ],
"!extends": "eslint:recommended",
"extends": "eslint:recommended",
"rules": {
"no-console": 0,
"no-bitwise": 0,
"curly": 0,
"comma-style": [ 2, "last" ],
"comma-dangle": [ 2, "never" ],
"curly": 0,
"no-bitwise": 0,
"no-console": 0,
"no-trailing-spaces": 2,
"semi": [ 2, "always" ],
"comma-dangle": [ 2, "never" ]
"semi": [ 2, "always" ]
}
}

View File

@ -12,6 +12,7 @@
.*/prof.js
.*/cputils.js
.*/cptable.js
.*/cpexcel.js
.*/sbcs.js
.*/dbcs.js

36
.spelling Normal file
View File

@ -0,0 +1,36 @@
# codepage.js (C) 2013-present SheetJS -- http://sheetjs.com
SheetJS
js-codepage
codepage
encoding
# Encoding-related terms
Big5
GB2312
GB2312-80
Johab
Kamenický
KOI8
Mazovia
Shift-JIS
T.61
UTF-16
UTF-32
UTF-7
UTF-8
Wansung
halfwidth
# Third-party
FoxPro
nodejs
unicode.org
# Other terms
codepages
codepoint
codepoints
encodings
endian
repo
runtime

View File

@ -62,6 +62,9 @@ clean-baseline: ## Remove test baselines
## Code Checking
.PHONY: fullint
fullint: lint old-lint tslint flow mdlint ## Run all checks
.PHONY: lint
lint: $(TARGET) $(AUXTARGETS) ## Run eslint checks
@eslint --ext .js,.njs,.json,.html,.htm $(TARGET) $(AUXTARGETS) $(CMDS) $(HTMLLINT) package.json bower.json
@ -76,6 +79,11 @@ old-lint: $(TARGET) $(AUXTARGETS) ## Run jshint and jscs checks
@jscs $(TARGET) $(AUXTARGETS)
if [ -e $(CLOSURE) ]; then java -jar $(CLOSURE) $(REQS) $(FLOWTARGET) --jscomp_warning=reportUnknownTypes >/dev/null; fi
.PHONY: tslint
tslint: $(TARGET) ## Run typescript checks
#@npm install dtslint typescript
#@npm run-script dtslint
dtslint types
.PHONY: flow
flow: lint ## Run flow checker
@ -91,6 +99,12 @@ misc/coverage.html: $(TARGET) test.js
coveralls: ## Coverage Test + Send to coveralls.io
mocha --require blanket --reporter mocha-lcov-reporter -t 20000 | node ./node_modules/coveralls/bin/coveralls.js
MDLINT=README.md codepage.md
.PHONY: mdlint
mdlint: $(MDLINT) ## Check markdown documents
alex $^
mdspell -a -n -x -r --en-us $^
.PHONY: prof
prof:
cat misc/prof.js test.js > prof.js

View File

@ -48,13 +48,12 @@ the object, edit the `JSVAR` shell variable in `make.sh` and run the script.
The utilities functions are contained in `cputils.js`, which assumes that the
appropriate codepage scripts were loaded.
The script will manipulate `module.exports` if available (e.g. in a CommonJS
`require` context). This is not always desirable. To prevent the behavior,
define `DO_NOT_EXPORT_CODEPAGE`.
The script will manipulate `module.exports` if available . This is not always
desirable. To prevent the behavior, define `DO_NOT_EXPORT_CODEPAGE`.
## Usage
Most codepages are indexed by number. To get the unicode character for a given
Most codepages are indexed by number. To get the Unicode character for a given
codepoint, use the `dec` property:
```js
@ -79,8 +78,8 @@ var sbuf = cptable.utils.encode(65001, sushi);
`cptable.utils.encode(CP, data, ofmt)` accepts a String or Array of characters
and returns a representation controlled by `ofmt`:
- Default output is a Buffer (or Array) of bytes (integers between 0 and 255).
- If `ofmt == 'str'`, return a String where `o.charCodeAt(i)` is the `i`-th byte
- Default output is a Buffer (or Array) of bytes (integers between 0 and 255)
- If `ofmt == 'str'`, return a binary String (byte `i` is `o.charCodeAt(i)`)
- If `ofmt == 'arr'`, return an Array of bytes
`cptable.utils.decode(CP, data)` accepts a byte String or Array of numbers or
@ -112,7 +111,7 @@ $ bash make.sh path_to_manifest output_file_name JSVAR
where
- `JSVAR` is the name of the exported variable (generally `cptable`)
- `output_file_name` is the output file (e.g. `cpexcel.js`, `cptable.js`)
- `output_file_name` is the output file (`cpexcel.js`, `cptable.js`, ...)
- `path_to_manifest` is the path to the manifest file.
The manifest file is expected to be a CSV with 3 columns:
@ -138,10 +137,10 @@ the JS source is `codepage.md`, so building is as simple as `voc codepage.md`.
## Generated Codepages
The complete list of hardcoded codepages can be found in the file `pages.csv`.
The complete list of codepages can be found in the file `pages.csv`.
Some codepages are easier to implement algorithmically. Since these are
hardcoded in `utils`, there is no corresponding entry (they are "magic").
Some codepages are easier to implement algorithmically. Since those character
tables are not generated, there is no corresponding entry (they are "magic").
| CP# | Source | Description |
|--------:|:-----------:|:-----------------------------------------------------|
@ -222,7 +221,7 @@ hardcoded in `utils`, there is no corresponding entry (they are "magic").
| `12001` | magic | Unicode UTF-32, big endian byte order |
| `20000` | Windows 7 | CNS Taiwan (Chinese Traditional) |
| `20001` | Windows 7 | TCA Taiwan |
| `20002` | Windows 7 | Eten Taiwan (Chinese Traditional) |
| `20002` | Windows 7 | ETEN Taiwan (Chinese Traditional) |
| `20003` | Windows 7 | IBM5550 Taiwan |
| `20004` | Windows 7 | TeleText Taiwan |
| `20005` | Windows 7 | Wang Taiwan |
@ -299,21 +298,21 @@ hardcoded in `utils`, there is no corresponding entry (they are "magic").
| `65001` | magic | Unicode (UTF-8) |
`unicode.org` refers to the Unicode Consortium Public Mappings, a database of
various mappings between unicode characters and respective character sets. The
various mappings between Unicode characters and respective character sets. The
tables are processed by a few scripts in the build process.
`IBM` refers to the IBM coded character set database. Even though IBM uses a
different numbering scheme from Windows, the IBM numbers are used when there is
no conflict. The tables are manually generated from the symbol PDFs.
no conflict. The tables are manually generated from the symbol manifests.
`Windows 7` refers to direct inspection of Windows 7 machines using .NET class
`System.Text.Encoding`. The enclosed `MakeEncoding.cs` C# program brute-forces
code pages. MakeEncoding.cs deviates from unicode.org in some cases. When they
code pages. `MakeEncoding.cs` deviates from unicode.org in some cases. When they
map a given code to different characters, unicode.org value is used. When
unicode.org does not prescribe a value, MakeEncoding.cs value is used.
unicode.org does not prescribe a value, `MakeEncoding.cs` value is used.
`NLS` refers to the National Language Support files supplied in various versions
of Windows. In older versions of Windows (e.g. Windows 98) these files followed
of Windows. In older versions of Windows (like Windows 98) these files followed
the name pattern `CP_#.NLS`, but newer versions use the name pattern `C_#.NLS`.
## Testing

View File

@ -1,6 +1,7 @@
#!/usr/bin/env node
/* js-codepage (C) 2014-present SheetJS -- http://sheetjs.com */
/* vim: set ts=2 ft=javascript: */
/* eslint-env node */
var codepage = require('../');
require('exit-on-epipe');
var fs = require('fs'), program/*:any*/ = (require('commander')/*:any*/);
@ -24,8 +25,8 @@ program.parse(process.argv);
if(program.list) {
var l/*:Array<number>*/ = [];
Object.keys(codepage).forEach(function(x) { if(parseInt(x) == +x) l.push(+x); });
Object.keys(codepage.utils.magic).forEach(function(x) { if(parseInt(x) == +x && +x != 16969) l.push(+x); });
Object.keys(codepage).forEach(function(x) { if(parseInt(x, 10) == +x) l.push(+x); });
Object.keys(codepage.utils.magic).forEach(function(x) { if(parseInt(x, 10) == +x && +x != 16969) l.push(+x); });
l.sort(function(a,b) { return a-b; }).forEach(function(x) { console.log(x); });
process.exit();
}
@ -43,11 +44,12 @@ if(f !== "-" && !fs.existsSync(f)) {
}
function concat(func) {
// $FlowIgnore
var writable = require('stream').Writable();
var buf = [];
writable._write = function(chunk, e, cb) { console.error(chunk.length); buf.push(chunk); cb(); };
writable._writev = function(chunks, cb) { console.error(chunks.length, chunks.map(x => x.length)); chunks.forEach(function(c) { buf.push(c); cb(); }); };
writable.on('finish', function() { console.error(buf.length, "end"); func(Buffer.concat(buf)); });
writable._write = function(chunk, e, cb) { buf.push(chunk); cb(); };
writable._writev = function(chunks, cb) { chunks.forEach(function(c) { buf.push(c.chunk); cb(); }); };
writable.on('finish', function() { func(Buffer.concat(buf)); });
return writable;
}
@ -55,7 +57,7 @@ if(f === "-") process.stdin.pipe(concat(process_text));
else process_text(fs.readFileSync(f));
function process_text(text/*:Buffer*/) {
var dec/*:Buffer*/ = codepage.utils.decode(fr, text);
var dec/*:Buffer*/ = (codepage.utils.decode(fr, text)/*:any*/);
var bom/*:Array<Buffer>*/ = [];
bom[1200] = new Buffer([0xFF, 0xFE]);

View File

@ -1,6 +1,6 @@
# Getting Codepages
The fields of the pages.csv manifest are `codepage,url,bytes` (SBCS=1, DBCS=2)
The fields of the `pages.csv` manifest are `codepage,url,bytes` (SBCS=1, DBCS=2)
```>pages.csv
37,http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/EBCDIC/CP037.TXT,1
@ -106,7 +106,7 @@ The following codepages are available in .NET on Windows:
- 10082 Croatian (Mac)
- 20000 CNS Taiwan; Chinese Traditional (CNS)
- 20001 TCA Taiwan
- 20002 Eten Taiwan; Chinese Traditional (Eten)
- 20002 ETEN Taiwan; Chinese Traditional (ETEN)
- 20003 IBM5550 Taiwan
- 20004 TeleText Taiwan
- 20005 Wang Taiwan
@ -143,8 +143,8 @@ The following codepages are available in .NET on Windows:
- 29001 Europa 3
- 38598 ISO 8859-8 Hebrew; Hebrew (ISO-Logical)
- 50220 ISO 2022 Japanese with no halfwidth Katakana; Japanese (JIS)
- 50221 ISO 2022 Japanese with halfwidth Katakana; Japanese (JIS-Allow 1 byte Kana)
- 50222 ISO 2022 Japanese JIS X 0201-1989; Japanese (JIS-Allow 1 byte Kana - SO/SI)
- 50221 ISO 2022 Japanese with halfwidth Katakana; Japanese (JIS Allow 1 byte Kana)
- 50222 ISO 2022 Japanese JIS X 0201-1989; Japanese (JIS Allow 1 byte Kana - SO/SI)
- 50225 ISO 2022 Korean
- 50227 ISO 2022 Simplified Chinese; Chinese Simplified (ISO 2022)
- 51932 EUC Japanese
@ -267,7 +267,7 @@ The following codepages are dependencies for Visual FoxPro:
## Building Notes
The script `make.sh` (described later) will get these files and massage the data
(printing code-unicode pairs). The eventual tables are dropped in the paths
(printing code-Unicode pairs). The eventual tables are dropped in the paths
`./codepages/<CODEPAGE>.TBL`. For example, the last 10 lines of `10000.TBL` are
```>
@ -283,13 +283,13 @@ The script `make.sh` (described later) will get these files and massage the data
0xFF 0x02C7
```
which implies that code 0xF6 is `String.fromCharCode(0x02C6)` and vice versa.
which implies that code `0xF6` is `String.fromCharCode(0x02C6)` and vice versa.
## Windows-dependent build step
To build the sources on windows, consult `dotnet/MakeEncoding.cs`.
After saving the standard output to `out`, a simple awk script (`dotnet.sh`) takes care of the rest:
After saving the standard output to `out`, a simple script processes the result:
```>dotnet.sh
#!/bin/bash
@ -325,7 +325,7 @@ var y/*:Array<Array<number> >*/ = x.split("\n").map(function(z/*:string*/)/*:Arr
```
The DBCS and SBCS code generation strategies are different. The maximum code is
used to distinguish (max 0xFF for SBCS).
used to distinguish (max `0xFF` for SBCS).
```
for(i = 0; i != y.length; ++i) if(y[i][0] > maxcp) maxcp = y[i][0];
@ -341,7 +341,7 @@ if(maxcp < 256) {
/*:: if(Array.isArray(dec)) { */
```
The unicode character `0xFFFD` (REPLACEMENT CHARACTER) is used as a placeholder
The Unicode character `0xFFFD` (REPLACEMENT CHARACTER) is used as a placeholder
for characters that are not specified in the map (for example, `0xF0` is not in
code page 10000).
@ -356,7 +356,7 @@ The `dec` field is merely a split of the string, and `enc` is an eversion:
} else {
```
DBCS is similar, except that the space is sliced into 256-byte chunks (strings
DBCS is similar, except that the space is sliced in chunks of 256 bytes (strings
are only generated for those high-bytes represented in the codepage).
The strategy is to construct an array-of-arrays so that `dd[high][low]` is the
@ -384,9 +384,9 @@ process.stdout.write(jsvar + "[" + cp + "] = " + outstr + "\n");
```
`make.sh` generates the tables used by `make.njs`. The raw unicode TXT files
`make.sh` generates the tables used by `make.njs`. The raw Unicode TXT files
are columnar: `code unicode #comments`. For example, the last 10 lines of the
text file ROMAN.TXT (for CP 10000) are:
text file `ROMAN.TXT` (for CP 10000) are:
```>
0xF6 0x02C6 #MODIFIER LETTER CIRCUMFLEX ACCENT
@ -427,6 +427,7 @@ awk -F, '{print $1, $2, $3}' $INFILE | while read cp url cptype; do
sed 's/"\([0-9]+\)":/\1:/g' <bits/$cp.js.tmp >bits/$cp.js
rm -f bits/$cp.js.tmp
done
echo "// eslint-disable-next-line no-undef" >> $OUTFILE.tmp
echo "if (typeof module !== 'undefined' && module.exports && typeof DO_NOT_EXPORT_CODEPAGE === 'undefined') module.exports = $JSVAR;" >> $OUTFILE.tmp
sed 's/"\([0-9]+\)":/\1:/g' <$OUTFILE.tmp >$OUTFILE
rm -f $OUTFILE.tmp
@ -434,7 +435,7 @@ rm -f $OUTFILE.tmp
## Utilities
The encode and decode functions are kept in a separate script (cputils.js).
The encode and decode functions are kept in a separate script (`cputils.js`).
Both encode and decode deal with data represented as:
@ -447,7 +448,7 @@ while the input format is automatically determined.
# Tests
The tests include JS validity tests (requiring or eval'ing code):
The tests include JS validity tests (requiring or evaluating code):
```>test.js
var fs = require('fs'), assert = require('assert'), vm = require('vm');
@ -639,7 +640,7 @@ function testfile(f,cp,type,skip) {
}
```
The `utf8` tests verify utf8 encoding of the actual JS sources:
The `utf8` tests verify UTF-8 encoding of the actual JS sources:
```>test.js
describe('node natives', function() {
@ -665,7 +666,7 @@ describe('node natives', function() {
});
```
The utf* and ascii tests attempt to test other magic formats:
The `utf*` and `ascii` tests attempt to test other magic formats:
```>test.js
var m = cptable.utils.magic;
@ -753,41 +754,64 @@ describe('failures', function() {
```json>package.json
{
"name": "codepage",
"version": "1.11.0",
"version": "1.12.0",
"author": "SheetJS",
"description": "pure-JS library to handle codepages",
"keywords": [ "codepage", "iconv", "convert", "strings" ],
"bin": {
"codepage": "./bin/codepage.njs"
},
"files": [
"LICENSE",
"README.md",
"bin",
"cptable.js",
"cputils.js",
"dist/cpexcel.full.js"
],
"main": "cputils.js",
"types": "types",
"browser": {
"buffer": "false"
},
"dependencies": {
"voc":"~1.0.0",
"exit-on-epipe":"~1.0.1",
"commander":"~2.11.0"
"commander": "~2.11.0",
"exit-on-epipe": "~1.0.1",
"voc": "~1.0.0"
},
"devDependencies": {
"mocha":"~2.5.3"
"mocha": "~2.5.3",
"blanket": "~1.2.3",
"@sheetjs/uglify-js": "~2.7.3",
"@types/node": "^8.0.7",
"@types/commander": "^2.9.0",
"dtslint": "^0.1.2",
"typescript": "2.2.0"
},
"repository": { "type":"git", "url":"git://github.com/SheetJS/js-codepage.git"},
"scripts": {
"pretest": "git submodule init && git submodule update",
"test": "make test",
"build": "make js"
"build": "make js",
"lint": "make fullint",
"dtslint": "dtslint types"
},
"config": {
"blanket": {
"pattern": "[cputils.js]"
}
},
"alex": {
"allow": [
"chinese",
"european",
"german",
"japanese",
"latin"
]
},
"homepage": "http://sheetjs.com/opensource",
"files": [
"LICENSE",
"README.md",
"bin",
"cptable.js",
"cputils.js",
"dist/sbcs.full.js",
"dist/cpexcel.full.js"
],
"bugs": { "url": "https://github.com/SheetJS/js-codepage/issues" },
"license": "Apache-2.0",
"engines": { "node": ">=0.8" }

View File

@ -1,6 +1,6 @@
/* cpexcel.js (C) 2013-present SheetJS -- http://sheetjs.com */
/*jshint -W100 */
var cptable = {version:"1.11.0"};
var cptable = {version:"1.12.0"};
cptable[437] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
cptable[620] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÇüéâäàąçêëèïîćÄĄĘęłôöĆûùŚÖÜ¢Ł¥śƒŹŻóÓńŃźż¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
cptable[737] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩαβγδεζηθικλμνξοπρσςτυφχψ░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀ωάέήϊίόύϋώΆΈΉΊΌΎΏ±≥≤ΪΫ÷≈°∙·√ⁿ²■ ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
@ -973,4 +973,5 @@ return {"enc": e, "dec": d }; })();
cptable[10029] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
cptable[10079] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüÝ°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ—“”÷◊ÿŸ¤ÐðÞþý·„‰ÂÊÁËÈÍÎÏÌÓÔ<C393>ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
cptable[10081] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ—“”÷◊ÿŸĞğİıŞş‡·„‰ÂÊÁËÈÍÎÏÌÓÔ<C393>ÒÚÛÙ<C39B>ˆ˜¯˘˙˚¸˝˛ˇ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
// eslint-disable-next-line no-undef
if (typeof module !== 'undefined' && module.exports && typeof DO_NOT_EXPORT_CODEPAGE === 'undefined') module.exports = cptable;

View File

@ -1,6 +1,6 @@
/* cptable.js (C) 2013-present SheetJS -- http://sheetjs.com */
/*jshint -W100 */
var cptable = {version:"1.11.0"};
var cptable = {version:"1.12.0"};
cptable[37] = (function(){ var d = "\u0000\u0001\u0002\u0003œ\t†—Ž\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013…\b‡\u0018\u0019’\u001c\u001d\u001e\u001f€‚ƒ„\n\u0017\u001bˆ‰Š‹Œ\u0005\u0006\u0007‘\u0016“”•–\u0004˜™š›\u0014\u0015ž\u001a  âäàáãåçñ¢.<(+|&éêëèíîïìß!$*);¬-/ÂÄÀÁÃÅÇѦ,%_>?øÉÊËÈÍÎÏÌ`:#@'=\"Øabcdefghi«»ðýþ±°jklmnopqrªºæ¸Æ¤µ~stuvwxyz¡¿ÐÝÞ®^£¥·©§¶¼½¾[]¯¨´×{ABCDEFGHI­ôöòóõ}JKLMNOPQR¹ûüùúÿ\\÷STUVWXYZ²ÔÖÒÓÕ0123456789³ÛÜÙڟ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
cptable[437] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
cptable[500] = (function(){ var d = "\u0000\u0001\u0002\u0003œ\t†—Ž\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013…\b‡\u0018\u0019’\u001c\u001d\u001e\u001f€‚ƒ„\n\u0017\u001bˆ‰Š‹Œ\u0005\u0006\u0007‘\u0016“”•–\u0004˜™š›\u0014\u0015ž\u001a  âäàáãåçñ[.<(+!&éêëèíîïìß]$*);^-/ÂÄÀÁÃÅÇѦ,%_>?øÉÊËÈÍÎÏÌ`:#@'=\"Øabcdefghi«»ðýþ±°jklmnopqrªºæ¸Æ¤µ~stuvwxyz¡¿ÐÝÞ®¢£¥·©§¶¼½¾¬|¯¨´×{ABCDEFGHI­ôöòóõ}JKLMNOPQR¹ûüùúÿ\\÷STUVWXYZ²ÔÖÒÓÕ0123456789³ÛÜÙڟ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
@ -6343,4 +6343,5 @@ for(j = 0; j != D[239].length; ++j) if(D[239][j].charCodeAt(0) !== 0xFFFD) { e[D
return {"enc": e, "dec": d }; })();
cptable[620] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÇüéâäàąçêëèïîćÄĄĘęłôöĆûùŚÖÜ¢Ł¥śƒŹŻóÓńŃźż¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
cptable[895] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ČüéďäĎŤčěĚĹÍľǪÄÁÉžŽôöÓůÚýÖÜŠĽÝŘťáíóúňŇŮÔšřŕŔ¼§«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
// eslint-disable-next-line no-undef
if (typeof module !== 'undefined' && module.exports && typeof DO_NOT_EXPORT_CODEPAGE === 'undefined') module.exports = cptable;

View File

@ -2,12 +2,15 @@
/* vim: set ft=javascript: */
/*jshint newcap: false */
/*::
declare var DO_NOT_EXPORT_CODEPAGE:?boolean;
type Decoder = (data:Data)=>string;
type Encoder = (data:StrData, ofmt:?string)=>Data;
type EncoderMap = {[id:CPIndex]:Encoder};
type DecoderMap = {[id:CPIndex]:Decoder};
*/
(function(root/*:any*/, factory) {
/*jshint ignore:start */
/*eslint-disable */
"use strict";
if(typeof cptable === "undefined") {
if(typeof require !== "undefined"){
@ -16,8 +19,11 @@ type DecoderMap = {[id:CPIndex]:Decoder};
else root.cptable = factory(cpt);
} else throw new Error("cptable not found");
} else cptable = factory(cptable);
/*eslint-enable */
/*jshint ignore:end */
}(this, function(cpt/*:CPTable*/){
"use strict";
/*global module, Buffer */
var magic/*:{[id:CPIndex]:string}*/ = {
"1200":"utf16le",
"1201":"utf16be",
@ -275,7 +281,7 @@ type DecoderMap = {[id:CPIndex]:Decoder};
}
}
};
var null_enc = function(data/*:StrData*/, ofmt/*:?string*/) { return ""; };
var null_enc = function(data/*:StrData*/, ofmt/*:?string*/) { void ofmt; return ""; };
var cp_decache = function cp_decache(cp/*:CPIndex*/)/*:void*/ { delete cpdcache[cp]; delete cpecache[cp]; };
var decache = function decache() {
if(has_buf) {
@ -497,6 +503,7 @@ type DecoderMap = {[id:CPIndex]:Decoder};
if(data[i] !== 0x2b) { j=1; out[k++] = String.fromCharCode(data[i]); continue; }
j=1;
if(data[i+1] === 0x2d) { j = 2; out[k++] = "+"; continue; }
// eslint-disable-next-line no-useless-escape
while(String.fromCharCode(data[i+j]).match(/[A-Za-z0-9+\/]/)) j++;
var dash = 0;
if(data[i+j] === 0x2d) { ++j; dash=1; }

View File

@ -2,6 +2,8 @@
/* vim: set ft=javascript: */
/*jshint newcap: false */
(function(root, factory) {
/*jshint ignore:start */
/*eslint-disable */
"use strict";
if(typeof cptable === "undefined") {
if(typeof require !== "undefined"){
@ -10,8 +12,11 @@
else root.cptable = factory(cpt);
} else throw new Error("cptable not found");
} else cptable = factory(cptable);
/*eslint-enable */
/*jshint ignore:end */
}(this, function(cpt){
"use strict";
/*global module, Buffer */
var magic = {
"1200":"utf16le",
"1201":"utf16be",
@ -265,7 +270,7 @@
}
}
};
var null_enc = function(data, ofmt) { return ""; };
var null_enc = function(data, ofmt) { void ofmt; return ""; };
var cp_decache = function cp_decache(cp) { delete cpdcache[cp]; delete cpecache[cp]; };
var decache = function decache() {
if(has_buf) {
@ -479,6 +484,7 @@
if(data[i] !== 0x2b) { j=1; out[k++] = String.fromCharCode(data[i]); continue; }
j=1;
if(data[i+1] === 0x2d) { j = 2; out[k++] = "+"; continue; }
// eslint-disable-next-line no-useless-escape
while(String.fromCharCode(data[i+j]).match(/[A-Za-z0-9+\/]/)) j++;
var dash = 0;
if(data[i+j] === 0x2d) { ++j; dash=1; }

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

11
dist/cpexcel.full.js vendored
View File

@ -1,6 +1,6 @@
/* cpexcel.js (C) 2013-present SheetJS -- http://sheetjs.com */
/*jshint -W100 */
var cptable = {version:"1.11.0"};
var cptable = {version:"1.12.0"};
cptable[437] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
cptable[620] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÇüéâäàąçêëèïîćÄĄĘęłôöĆûùŚÖÜ¢Ł¥śƒŹŻóÓńŃźż¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
cptable[737] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩαβγδεζηθικλμνξοπρσςτυφχψ░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀ωάέήϊίόύϋώΆΈΉΊΌΎΏ±≥≤ΪΫ÷≈°∙·√ⁿ²■ ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
@ -973,11 +973,14 @@ return {"enc": e, "dec": d }; })();
cptable[10029] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
cptable[10079] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüÝ°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ—“”÷◊ÿŸ¤ÐðÞþý·„‰ÂÊÁËÈÍÎÏÌÓÔ<C393>ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
cptable[10081] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ—“”÷◊ÿŸĞğİıŞş‡·„‰ÂÊÁËÈÍÎÏÌÓÔ<C393>ÒÚÛÙ<C39B>ˆ˜¯˘˙˚¸˝˛ˇ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
// eslint-disable-next-line no-undef
if (typeof module !== 'undefined' && module.exports && typeof DO_NOT_EXPORT_CODEPAGE === 'undefined') module.exports = cptable;
/* cputils.js (C) 2013-present SheetJS -- http://sheetjs.com */
/* vim: set ft=javascript: */
/*jshint newcap: false */
(function(root, factory) {
/*jshint ignore:start */
/*eslint-disable */
"use strict";
if(typeof cptable === "undefined") {
if(typeof require !== "undefined"){
@ -986,8 +989,11 @@ if (typeof module !== 'undefined' && module.exports && typeof DO_NOT_EXPORT_CODE
else root.cptable = factory(cpt);
} else throw new Error("cptable not found");
} else cptable = factory(cptable);
/*eslint-enable */
/*jshint ignore:end */
}(this, function(cpt){
"use strict";
/*global module, Buffer */
var magic = {
"1200":"utf16le",
"1201":"utf16be",
@ -1241,7 +1247,7 @@ if (typeof module !== 'undefined' && module.exports && typeof DO_NOT_EXPORT_CODE
}
}
};
var null_enc = function(data, ofmt) { return ""; };
var null_enc = function(data, ofmt) { void ofmt; return ""; };
var cp_decache = function cp_decache(cp) { delete cpdcache[cp]; delete cpecache[cp]; };
var decache = function decache() {
if(has_buf) {
@ -1455,6 +1461,7 @@ if (typeof module !== 'undefined' && module.exports && typeof DO_NOT_EXPORT_CODE
if(data[i] !== 0x2b) { j=1; out[k++] = String.fromCharCode(data[i]); continue; }
j=1;
if(data[i+1] === 0x2d) { j = 2; out[k++] = "+"; continue; }
// eslint-disable-next-line no-useless-escape
while(String.fromCharCode(data[i+j]).match(/[A-Za-z0-9+\/]/)) j++;
var dash = 0;
if(data[i+j] === 0x2d) { ++j; dash=1; }

3
dist/cpexcel.js vendored
View File

@ -1,6 +1,6 @@
/* cpexcel.js (C) 2013-present SheetJS -- http://sheetjs.com */
/*jshint -W100 */
var cptable = {version:"1.11.0"};
var cptable = {version:"1.12.0"};
cptable[437] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
cptable[620] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÇüéâäàąçêëèïîćÄĄĘęłôöĆûùŚÖÜ¢Ł¥śƒŹŻóÓńŃźż¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
cptable[737] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩαβγδεζηθικλμνξοπρσςτυφχψ░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀ωάέήϊίόύϋώΆΈΉΊΌΎΏ±≥≤ΪΫ÷≈°∙·√ⁿ²■ ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
@ -973,4 +973,5 @@ return {"enc": e, "dec": d }; })();
cptable[10029] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
cptable[10079] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüÝ°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ—“”÷◊ÿŸ¤ÐðÞþý·„‰ÂÊÁËÈÍÎÏÌÓÔ<C393>ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
cptable[10081] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ—“”÷◊ÿŸĞğİıŞş‡·„‰ÂÊÁËÈÍÎÏÌÓÔ<C393>ÒÚÛÙ<C39B>ˆ˜¯˘˙˚¸˝˛ˇ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
// eslint-disable-next-line no-undef
if (typeof module !== 'undefined' && module.exports && typeof DO_NOT_EXPORT_CODEPAGE === 'undefined') module.exports = cptable;

11
dist/cptable.full.js vendored
View File

@ -1,6 +1,6 @@
/* cptable.js (C) 2013-present SheetJS -- http://sheetjs.com */
/*jshint -W100 */
var cptable = {version:"1.11.0"};
var cptable = {version:"1.12.0"};
cptable[37] = (function(){ var d = "\u0000\u0001\u0002\u0003œ\t†—Ž\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013…\b‡\u0018\u0019’\u001c\u001d\u001e\u001f€‚ƒ„\n\u0017\u001bˆ‰Š‹Œ\u0005\u0006\u0007‘\u0016“”•–\u0004˜™š›\u0014\u0015ž\u001a  âäàáãåçñ¢.<(+|&éêëèíîïìß!$*);¬-/ÂÄÀÁÃÅÇѦ,%_>?øÉÊËÈÍÎÏÌ`:#@'=\"Øabcdefghi«»ðýþ±°jklmnopqrªºæ¸Æ¤µ~stuvwxyz¡¿ÐÝÞ®^£¥·©§¶¼½¾[]¯¨´×{ABCDEFGHI­ôöòóõ}JKLMNOPQR¹ûüùúÿ\\÷STUVWXYZ²ÔÖÒÓÕ0123456789³ÛÜÙڟ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
cptable[437] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
cptable[500] = (function(){ var d = "\u0000\u0001\u0002\u0003œ\t†—Ž\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013…\b‡\u0018\u0019’\u001c\u001d\u001e\u001f€‚ƒ„\n\u0017\u001bˆ‰Š‹Œ\u0005\u0006\u0007‘\u0016“”•–\u0004˜™š›\u0014\u0015ž\u001a  âäàáãåçñ[.<(+!&éêëèíîïìß]$*);^-/ÂÄÀÁÃÅÇѦ,%_>?øÉÊËÈÍÎÏÌ`:#@'=\"Øabcdefghi«»ðýþ±°jklmnopqrªºæ¸Æ¤µ~stuvwxyz¡¿ÐÝÞ®¢£¥·©§¶¼½¾¬|¯¨´×{ABCDEFGHI­ôöòóõ}JKLMNOPQR¹ûüùúÿ\\÷STUVWXYZ²ÔÖÒÓÕ0123456789³ÛÜÙڟ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
@ -6343,11 +6343,14 @@ for(j = 0; j != D[239].length; ++j) if(D[239][j].charCodeAt(0) !== 0xFFFD) { e[D
return {"enc": e, "dec": d }; })();
cptable[620] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÇüéâäàąçêëèïîćÄĄĘęłôöĆûùŚÖÜ¢Ł¥śƒŹŻóÓńŃźż¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
cptable[895] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ČüéďäĎŤčěĚĹÍľǪÄÁÉžŽôöÓůÚýÖÜŠĽÝŘťáíóúňŇŮÔšřŕŔ¼§«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
// eslint-disable-next-line no-undef
if (typeof module !== 'undefined' && module.exports && typeof DO_NOT_EXPORT_CODEPAGE === 'undefined') module.exports = cptable;
/* cputils.js (C) 2013-present SheetJS -- http://sheetjs.com */
/* vim: set ft=javascript: */
/*jshint newcap: false */
(function(root, factory) {
/*jshint ignore:start */
/*eslint-disable */
"use strict";
if(typeof cptable === "undefined") {
if(typeof require !== "undefined"){
@ -6356,8 +6359,11 @@ if (typeof module !== 'undefined' && module.exports && typeof DO_NOT_EXPORT_CODE
else root.cptable = factory(cpt);
} else throw new Error("cptable not found");
} else cptable = factory(cptable);
/*eslint-enable */
/*jshint ignore:end */
}(this, function(cpt){
"use strict";
/*global module, Buffer */
var magic = {
"1200":"utf16le",
"1201":"utf16be",
@ -6611,7 +6617,7 @@ if (typeof module !== 'undefined' && module.exports && typeof DO_NOT_EXPORT_CODE
}
}
};
var null_enc = function(data, ofmt) { return ""; };
var null_enc = function(data, ofmt) { void ofmt; return ""; };
var cp_decache = function cp_decache(cp) { delete cpdcache[cp]; delete cpecache[cp]; };
var decache = function decache() {
if(has_buf) {
@ -6825,6 +6831,7 @@ if (typeof module !== 'undefined' && module.exports && typeof DO_NOT_EXPORT_CODE
if(data[i] !== 0x2b) { j=1; out[k++] = String.fromCharCode(data[i]); continue; }
j=1;
if(data[i+1] === 0x2d) { j = 2; out[k++] = "+"; continue; }
// eslint-disable-next-line no-useless-escape
while(String.fromCharCode(data[i+j]).match(/[A-Za-z0-9+\/]/)) j++;
var dash = 0;
if(data[i+j] === 0x2d) { ++j; dash=1; }

3
dist/cptable.js vendored
View File

@ -1,6 +1,6 @@
/* cptable.js (C) 2013-present SheetJS -- http://sheetjs.com */
/*jshint -W100 */
var cptable = {version:"1.11.0"};
var cptable = {version:"1.12.0"};
cptable[37] = (function(){ var d = "\u0000\u0001\u0002\u0003œ\t†—Ž\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013…\b‡\u0018\u0019’\u001c\u001d\u001e\u001f€‚ƒ„\n\u0017\u001bˆ‰Š‹Œ\u0005\u0006\u0007‘\u0016“”•–\u0004˜™š›\u0014\u0015ž\u001a  âäàáãåçñ¢.<(+|&éêëèíîïìß!$*);¬-/ÂÄÀÁÃÅÇѦ,%_>?øÉÊËÈÍÎÏÌ`:#@'=\"Øabcdefghi«»ðýþ±°jklmnopqrªºæ¸Æ¤µ~stuvwxyz¡¿ÐÝÞ®^£¥·©§¶¼½¾[]¯¨´×{ABCDEFGHI­ôöòóõ}JKLMNOPQR¹ûüùúÿ\\÷STUVWXYZ²ÔÖÒÓÕ0123456789³ÛÜÙڟ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
cptable[437] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
cptable[500] = (function(){ var d = "\u0000\u0001\u0002\u0003œ\t†—Ž\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013…\b‡\u0018\u0019’\u001c\u001d\u001e\u001f€‚ƒ„\n\u0017\u001bˆ‰Š‹Œ\u0005\u0006\u0007‘\u0016“”•–\u0004˜™š›\u0014\u0015ž\u001a  âäàáãåçñ[.<(+!&éêëèíîïìß]$*);^-/ÂÄÀÁÃÅÇѦ,%_>?øÉÊËÈÍÎÏÌ`:#@'=\"Øabcdefghi«»ðýþ±°jklmnopqrªºæ¸Æ¤µ~stuvwxyz¡¿ÐÝÞ®¢£¥·©§¶¼½¾¬|¯¨´×{ABCDEFGHI­ôöòóõ}JKLMNOPQR¹ûüùúÿ\\÷STUVWXYZ²ÔÖÒÓÕ0123456789³ÛÜÙڟ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
@ -6343,4 +6343,5 @@ for(j = 0; j != D[239].length; ++j) if(D[239][j].charCodeAt(0) !== 0xFFFD) { e[D
return {"enc": e, "dec": d }; })();
cptable[620] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÇüéâäàąçêëèïîćÄĄĘęłôöĆûùŚÖÜ¢Ł¥śƒŹŻóÓńŃźż¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
cptable[895] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ČüéďäĎŤčěĚĹÍľǪÄÁÉžŽôöÓůÚýÖÜŠĽÝŘťáíóúňŇŮÔšřŕŔ¼§«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
// eslint-disable-next-line no-undef
if (typeof module !== 'undefined' && module.exports && typeof DO_NOT_EXPORT_CODEPAGE === 'undefined') module.exports = cptable;

8
dist/cputils.js vendored
View File

@ -2,6 +2,8 @@
/* vim: set ft=javascript: */
/*jshint newcap: false */
(function(root, factory) {
/*jshint ignore:start */
/*eslint-disable */
"use strict";
if(typeof cptable === "undefined") {
if(typeof require !== "undefined"){
@ -10,8 +12,11 @@
else root.cptable = factory(cpt);
} else throw new Error("cptable not found");
} else cptable = factory(cptable);
/*eslint-enable */
/*jshint ignore:end */
}(this, function(cpt){
"use strict";
/*global module, Buffer */
var magic = {
"1200":"utf16le",
"1201":"utf16be",
@ -265,7 +270,7 @@
}
}
};
var null_enc = function(data, ofmt) { return ""; };
var null_enc = function(data, ofmt) { void ofmt; return ""; };
var cp_decache = function cp_decache(cp) { delete cpdcache[cp]; delete cpecache[cp]; };
var decache = function decache() {
if(has_buf) {
@ -479,6 +484,7 @@
if(data[i] !== 0x2b) { j=1; out[k++] = String.fromCharCode(data[i]); continue; }
j=1;
if(data[i+1] === 0x2d) { j = 2; out[k++] = "+"; continue; }
// eslint-disable-next-line no-useless-escape
while(String.fromCharCode(data[i+j]).match(/[A-Za-z0-9+\/]/)) j++;
var dash = 0;
if(data[i+j] === 0x2d) { ++j; dash=1; }

11
dist/sbcs.full.js vendored
View File

@ -1,6 +1,6 @@
/* sbcs.js (C) 2013-present SheetJS -- http://sheetjs.com */
/*jshint -W100 */
var cptable = {version:"1.11.0"};
var cptable = {version:"1.12.0"};
cptable[37] = (function(){ var d = "\u0000\u0001\u0002\u0003œ\t†—Ž\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013…\b‡\u0018\u0019’\u001c\u001d\u001e\u001f€‚ƒ„\n\u0017\u001bˆ‰Š‹Œ\u0005\u0006\u0007‘\u0016“”•–\u0004˜™š›\u0014\u0015ž\u001a  âäàáãåçñ¢.<(+|&éêëèíîïìß!$*);¬-/ÂÄÀÁÃÅÇѦ,%_>?øÉÊËÈÍÎÏÌ`:#@'=\"Øabcdefghi«»ðýþ±°jklmnopqrªºæ¸Æ¤µ~stuvwxyz¡¿ÐÝÞ®^£¥·©§¶¼½¾[]¯¨´×{ABCDEFGHI­ôöòóõ}JKLMNOPQR¹ûüùúÿ\\÷STUVWXYZ²ÔÖÒÓÕ0123456789³ÛÜÙڟ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
cptable[437] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
cptable[500] = (function(){ var d = "\u0000\u0001\u0002\u0003œ\t†—Ž\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013…\b‡\u0018\u0019’\u001c\u001d\u001e\u001f€‚ƒ„\n\u0017\u001bˆ‰Š‹Œ\u0005\u0006\u0007‘\u0016“”•–\u0004˜™š›\u0014\u0015ž\u001a  âäàáãåçñ[.<(+!&éêëèíîïìß]$*);^-/ÂÄÀÁÃÅÇѦ,%_>?øÉÊËÈÍÎÏÌ`:#@'=\"Øabcdefghi«»ðýþ±°jklmnopqrªºæ¸Æ¤µ~stuvwxyz¡¿ÐÝÞ®¢£¥·©§¶¼½¾¬|¯¨´×{ABCDEFGHI­ôöòóõ}JKLMNOPQR¹ûüùúÿ\\÷STUVWXYZ²ÔÖÒÓÕ0123456789³ÛÜÙڟ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
@ -107,11 +107,14 @@ cptable[29001] = (function(){ var d = "ΈΉΊΌΎ°◘○◙♂♀♪♬
cptable[38598] = (function(){ var d = "\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¢£¤¥¦§¨©×«¬­®‾°±²³´µ¶·¸¹÷»¼½¾‗אבגדהוזחטיךכלםמןנסעףפץצקרשת", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
cptable[620] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÇüéâäàąçêëèïîćÄĄĘęłôöĆûùŚÖÜ¢Ł¥śƒŹŻóÓńŃźż¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
cptable[895] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ČüéďäĎŤčěĚĹÍľǪÄÁÉžŽôöÓůÚýÖÜŠĽÝŘťáíóúňŇŮÔšřŕŔ¼§«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
// eslint-disable-next-line no-undef
if (typeof module !== 'undefined' && module.exports && typeof DO_NOT_EXPORT_CODEPAGE === 'undefined') module.exports = cptable;
/* cputils.js (C) 2013-present SheetJS -- http://sheetjs.com */
/* vim: set ft=javascript: */
/*jshint newcap: false */
(function(root, factory) {
/*jshint ignore:start */
/*eslint-disable */
"use strict";
if(typeof cptable === "undefined") {
if(typeof require !== "undefined"){
@ -120,8 +123,11 @@ if (typeof module !== 'undefined' && module.exports && typeof DO_NOT_EXPORT_CODE
else root.cptable = factory(cpt);
} else throw new Error("cptable not found");
} else cptable = factory(cptable);
/*eslint-enable */
/*jshint ignore:end */
}(this, function(cpt){
"use strict";
/*global module, Buffer */
var magic = {
"1200":"utf16le",
"1201":"utf16be",
@ -375,7 +381,7 @@ if (typeof module !== 'undefined' && module.exports && typeof DO_NOT_EXPORT_CODE
}
}
};
var null_enc = function(data, ofmt) { return ""; };
var null_enc = function(data, ofmt) { void ofmt; return ""; };
var cp_decache = function cp_decache(cp) { delete cpdcache[cp]; delete cpecache[cp]; };
var decache = function decache() {
if(has_buf) {
@ -589,6 +595,7 @@ if (typeof module !== 'undefined' && module.exports && typeof DO_NOT_EXPORT_CODE
if(data[i] !== 0x2b) { j=1; out[k++] = String.fromCharCode(data[i]); continue; }
j=1;
if(data[i+1] === 0x2d) { j = 2; out[k++] = "+"; continue; }
// eslint-disable-next-line no-useless-escape
while(String.fromCharCode(data[i+j]).match(/[A-Za-z0-9+\/]/)) j++;
var dash = 0;
if(data[i+j] === 0x2d) { ++j; dash=1; }

3
dist/sbcs.js vendored
View File

@ -1,6 +1,6 @@
/* sbcs.js (C) 2013-present SheetJS -- http://sheetjs.com */
/*jshint -W100 */
var cptable = {version:"1.11.0"};
var cptable = {version:"1.12.0"};
cptable[37] = (function(){ var d = "\u0000\u0001\u0002\u0003œ\t†—Ž\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013…\b‡\u0018\u0019’\u001c\u001d\u001e\u001f€‚ƒ„\n\u0017\u001bˆ‰Š‹Œ\u0005\u0006\u0007‘\u0016“”•–\u0004˜™š›\u0014\u0015ž\u001a  âäàáãåçñ¢.<(+|&éêëèíîïìß!$*);¬-/ÂÄÀÁÃÅÇѦ,%_>?øÉÊËÈÍÎÏÌ`:#@'=\"Øabcdefghi«»ðýþ±°jklmnopqrªºæ¸Æ¤µ~stuvwxyz¡¿ÐÝÞ®^£¥·©§¶¼½¾[]¯¨´×{ABCDEFGHI­ôöòóõ}JKLMNOPQR¹ûüùúÿ\\÷STUVWXYZ²ÔÖÒÓÕ0123456789³ÛÜÙڟ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
cptable[437] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
cptable[500] = (function(){ var d = "\u0000\u0001\u0002\u0003œ\t†—Ž\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013…\b‡\u0018\u0019’\u001c\u001d\u001e\u001f€‚ƒ„\n\u0017\u001bˆ‰Š‹Œ\u0005\u0006\u0007‘\u0016“”•–\u0004˜™š›\u0014\u0015ž\u001a  âäàáãåçñ[.<(+!&éêëèíîïìß]$*);^-/ÂÄÀÁÃÅÇѦ,%_>?øÉÊËÈÍÎÏÌ`:#@'=\"Øabcdefghi«»ðýþ±°jklmnopqrªºæ¸Æ¤µ~stuvwxyz¡¿ÐÝÞ®¢£¥·©§¶¼½¾¬|¯¨´×{ABCDEFGHI­ôöòóõ}JKLMNOPQR¹ûüùúÿ\\÷STUVWXYZ²ÔÖÒÓÕ0123456789³ÛÜÙڟ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
@ -107,4 +107,5 @@ cptable[29001] = (function(){ var d = "ΈΉΊΌΎ°◘○◙♂♀♪♬
cptable[38598] = (function(){ var d = "\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¢£¤¥¦§¨©×«¬­®‾°±²³´µ¶·¸¹÷»¼½¾‗אבגדהוזחטיךכלםמןנסעףפץצקרשת", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
cptable[620] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÇüéâäàąçêëèïîćÄĄĘęłôöĆûùŚÖÜ¢Ł¥śƒŹŻóÓńŃźż¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
cptable[895] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ČüéďäĎŤčěĚĹÍľǪÄÁÉžŽôöÓůÚýÖÜŠĽÝŘťáíóúňŇŮÔšřŕŔ¼§«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
// eslint-disable-next-line no-undef
if (typeof module !== 'undefined' && module.exports && typeof DO_NOT_EXPORT_CODEPAGE === 'undefined') module.exports = cptable;

View File

@ -48,13 +48,12 @@ the object, edit the `JSVAR` shell variable in `make.sh` and run the script.
The utilities functions are contained in `cputils.js`, which assumes that the
appropriate codepage scripts were loaded.
The script will manipulate `module.exports` if available (e.g. in a CommonJS
`require` context). This is not always desirable. To prevent the behavior,
define `DO_NOT_EXPORT_CODEPAGE`.
The script will manipulate `module.exports` if available . This is not always
desirable. To prevent the behavior, define `DO_NOT_EXPORT_CODEPAGE`.
## Usage
Most codepages are indexed by number. To get the unicode character for a given
Most codepages are indexed by number. To get the Unicode character for a given
codepoint, use the `dec` property:
```js
@ -79,8 +78,8 @@ var sbuf = cptable.utils.encode(65001, sushi);
`cptable.utils.encode(CP, data, ofmt)` accepts a String or Array of characters
and returns a representation controlled by `ofmt`:
- Default output is a Buffer (or Array) of bytes (integers between 0 and 255).
- If `ofmt == 'str'`, return a String where `o.charCodeAt(i)` is the `i`-th byte
- Default output is a Buffer (or Array) of bytes (integers between 0 and 255)
- If `ofmt == 'str'`, return a binary String (byte `i` is `o.charCodeAt(i)`)
- If `ofmt == 'arr'`, return an Array of bytes
`cptable.utils.decode(CP, data)` accepts a byte String or Array of numbers or
@ -112,7 +111,7 @@ $ bash make.sh path_to_manifest output_file_name JSVAR
where
- `JSVAR` is the name of the exported variable (generally `cptable`)
- `output_file_name` is the output file (e.g. `cpexcel.js`, `cptable.js`)
- `output_file_name` is the output file (`cpexcel.js`, `cptable.js`, ...)
- `path_to_manifest` is the path to the manifest file.
The manifest file is expected to be a CSV with 3 columns:
@ -138,10 +137,10 @@ the JS source is `codepage.md`, so building is as simple as `voc codepage.md`.
## Generated Codepages
The complete list of hardcoded codepages can be found in the file `pages.csv`.
The complete list of codepages can be found in the file `pages.csv`.
Some codepages are easier to implement algorithmically. Since these are
hardcoded in `utils`, there is no corresponding entry (they are "magic").
Some codepages are easier to implement algorithmically. Since those character
tables are not generated, there is no corresponding entry (they are "magic").
| CP# | Source | Description |
|--------:|:-----------:|:-----------------------------------------------------|
@ -222,7 +221,7 @@ hardcoded in `utils`, there is no corresponding entry (they are "magic").
| `12001` | magic | Unicode UTF-32, big endian byte order |
| `20000` | Windows 7 | CNS Taiwan (Chinese Traditional) |
| `20001` | Windows 7 | TCA Taiwan |
| `20002` | Windows 7 | Eten Taiwan (Chinese Traditional) |
| `20002` | Windows 7 | ETEN Taiwan (Chinese Traditional) |
| `20003` | Windows 7 | IBM5550 Taiwan |
| `20004` | Windows 7 | TeleText Taiwan |
| `20005` | Windows 7 | Wang Taiwan |
@ -299,21 +298,21 @@ hardcoded in `utils`, there is no corresponding entry (they are "magic").
| `65001` | magic | Unicode (UTF-8) |
`unicode.org` refers to the Unicode Consortium Public Mappings, a database of
various mappings between unicode characters and respective character sets. The
various mappings between Unicode characters and respective character sets. The
tables are processed by a few scripts in the build process.
`IBM` refers to the IBM coded character set database. Even though IBM uses a
different numbering scheme from Windows, the IBM numbers are used when there is
no conflict. The tables are manually generated from the symbol PDFs.
no conflict. The tables are manually generated from the symbol manifests.
`Windows 7` refers to direct inspection of Windows 7 machines using .NET class
`System.Text.Encoding`. The enclosed `MakeEncoding.cs` C# program brute-forces
code pages. MakeEncoding.cs deviates from unicode.org in some cases. When they
code pages. `MakeEncoding.cs` deviates from unicode.org in some cases. When they
map a given code to different characters, unicode.org value is used. When
unicode.org does not prescribe a value, MakeEncoding.cs value is used.
unicode.org does not prescribe a value, `MakeEncoding.cs` value is used.
`NLS` refers to the National Language Support files supplied in various versions
of Windows. In older versions of Windows (e.g. Windows 98) these files followed
of Windows. In older versions of Windows (like Windows 98) these files followed
the name pattern `CP_#.NLS`, but newer versions use the name pattern `C_#.NLS`.
## Testing

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -48,13 +48,12 @@ the object, edit the +AGA-JSVAR+AGA shell variable in +AGA-make.sh+AGA and run t
The utilities functions are contained in +AGA-cputils.js+AGA, which assumes that the
appropriate codepage scripts were loaded.
The script will manipulate +AGA-module.exports+AGA if available (e.g. in a CommonJS
+AGA-require+AGA context). This is not always desirable. To prevent the behavior,
define +AGA-DO+AF8-NOT+AF8-EXPORT+AF8-CODEPAGE+AGA.
The script will manipulate +AGA-module.exports+AGA if available . This is not always
desirable. To prevent the behavior, define +AGA-DO+AF8-NOT+AF8-EXPORT+AF8-CODEPAGE+AGA.
+ACMAIw Usage
Most codepages are indexed by number. To get the unicode character for a given
Most codepages are indexed by number. To get the Unicode character for a given
codepoint, use the +AGA-dec+AGA property:
+AGAAYABg-js
@ -79,8 +78,8 @@ var sbuf +AD0 cptable.utils.encode(65001, sushi)+ADs
+AGA-cptable.utils.encode(CP, data, ofmt)+AGA accepts a String or Array of characters
and returns a representation controlled by +AGA-ofmt+AGA:
- Default output is a Buffer (or Array) of bytes (integers between 0 and 255).
- If +AGA-ofmt +AD0APQ 'str'+AGA, return a String where +AGA-o.charCodeAt(i)+AGA is the +AGA-i+AGA--th byte
- Default output is a Buffer (or Array) of bytes (integers between 0 and 255)
- If +AGA-ofmt +AD0APQ 'str'+AGA, return a binary String (byte +AGA-i+AGA is +AGA-o.charCodeAt(i)+AGA)
- If +AGA-ofmt +AD0APQ 'arr'+AGA, return an Array of bytes
+AGA-cptable.utils.decode(CP, data)+AGA accepts a byte String or Array of numbers or
@ -112,7 +111,7 @@ Usage:
where
- +AGA-JSVAR+AGA is the name of the exported variable (generally +AGA-cptable+AGA)
- +AGA-output+AF8-file+AF8-name+AGA is the output file (e.g. +AGA-cpexcel.js+AGA, +AGA-cptable.js+AGA)
- +AGA-output+AF8-file+AF8-name+AGA is the output file (+AGA-cpexcel.js+AGA, +AGA-cptable.js+AGA, ...)
- +AGA-path+AF8-to+AF8-manifest+AGA is the path to the manifest file.
The manifest file is expected to be a CSV with 3 columns:
@ -138,10 +137,10 @@ the JS source is +AGA-codepage.md+AGA, so building is as simple as +AGA-voc code
+ACMAIw Generated Codepages
The complete list of hardcoded codepages can be found in the file +AGA-pages.csv+AGA.
The complete list of codepages can be found in the file +AGA-pages.csv+AGA.
Some codepages are easier to implement algorithmically. Since these are
hardcoded in +AGA-utils+AGA, there is no corresponding entry (they are +ACI-magic+ACI).
Some codepages are easier to implement algorithmically. Since those character
tables are not generated, there is no corresponding entry (they are +ACI-magic+ACI).
+AHw CP+ACM +AHw Source +AHw Description +AHw
+AHw---------:+AHw:-----------:+AHw:-----------------------------------------------------+AHw
@ -222,7 +221,7 @@ hardcoded in +AGA-utils+AGA, there is no corresponding entry (they are +ACI-magi
+AHw +AGA-12001+AGA +AHw magic +AHw Unicode UTF-32, big endian byte order +AHw
+AHw +AGA-20000+AGA +AHw Windows 7 +AHw CNS Taiwan (Chinese Traditional) +AHw
+AHw +AGA-20001+AGA +AHw Windows 7 +AHw TCA Taiwan +AHw
+AHw +AGA-20002+AGA +AHw Windows 7 +AHw Eten Taiwan (Chinese Traditional) +AHw
+AHw +AGA-20002+AGA +AHw Windows 7 +AHw ETEN Taiwan (Chinese Traditional) +AHw
+AHw +AGA-20003+AGA +AHw Windows 7 +AHw IBM5550 Taiwan +AHw
+AHw +AGA-20004+AGA +AHw Windows 7 +AHw TeleText Taiwan +AHw
+AHw +AGA-20005+AGA +AHw Windows 7 +AHw Wang Taiwan +AHw
@ -299,21 +298,21 @@ hardcoded in +AGA-utils+AGA, there is no corresponding entry (they are +ACI-magi
+AHw +AGA-65001+AGA +AHw magic +AHw Unicode (UTF-8) +AHw
+AGA-unicode.org+AGA refers to the Unicode Consortium Public Mappings, a database of
various mappings between unicode characters and respective character sets. The
various mappings between Unicode characters and respective character sets. The
tables are processed by a few scripts in the build process.
+AGA-IBM+AGA refers to the IBM coded character set database. Even though IBM uses a
different numbering scheme from Windows, the IBM numbers are used when there is
no conflict. The tables are manually generated from the symbol PDFs.
no conflict. The tables are manually generated from the symbol manifests.
+AGA-Windows 7+AGA refers to direct inspection of Windows 7 machines using .NET class
+AGA-System.Text.Encoding+AGA. The enclosed +AGA-MakeEncoding.cs+AGA C+ACM program brute-forces
code pages. MakeEncoding.cs deviates from unicode.org in some cases. When they
code pages. +AGA-MakeEncoding.cs+AGA deviates from unicode.org in some cases. When they
map a given code to different characters, unicode.org value is used. When
unicode.org does not prescribe a value, MakeEncoding.cs value is used.
unicode.org does not prescribe a value, +AGA-MakeEncoding.cs+AGA value is used.
+AGA-NLS+AGA refers to the National Language Support files supplied in various versions
of Windows. In older versions of Windows (e.g. Windows 98) these files followed
of Windows. In older versions of Windows (like Windows 98) these files followed
the name pattern +AGA-CP+AF8AIw.NLS+AGA, but newer versions use the name pattern +AGA-C+AF8AIw.NLS+AGA.
+ACMAIw Testing

View File

@ -48,13 +48,12 @@ the object, edit the `JSVAR` shell variable in `make.sh` and run the script.
The utilities functions are contained in `cputils.js`, which assumes that the
appropriate codepage scripts were loaded.
The script will manipulate `module.exports` if available (e.g. in a CommonJS
`require` context). This is not always desirable. To prevent the behavior,
define `DO_NOT_EXPORT_CODEPAGE`.
The script will manipulate `module.exports` if available . This is not always
desirable. To prevent the behavior, define `DO_NOT_EXPORT_CODEPAGE`.
## Usage
Most codepages are indexed by number. To get the unicode character for a given
Most codepages are indexed by number. To get the Unicode character for a given
codepoint, use the `dec` property:
```js
@ -79,8 +78,8 @@ var sbuf = cptable.utils.encode(65001, sushi);
`cptable.utils.encode(CP, data, ofmt)` accepts a String or Array of characters
and returns a representation controlled by `ofmt`:
- Default output is a Buffer (or Array) of bytes (integers between 0 and 255).
- If `ofmt == 'str'`, return a String where `o.charCodeAt(i)` is the `i`-th byte
- Default output is a Buffer (or Array) of bytes (integers between 0 and 255)
- If `ofmt == 'str'`, return a binary String (byte `i` is `o.charCodeAt(i)`)
- If `ofmt == 'arr'`, return an Array of bytes
`cptable.utils.decode(CP, data)` accepts a byte String or Array of numbers or
@ -112,7 +111,7 @@ $ bash make.sh path_to_manifest output_file_name JSVAR
where
- `JSVAR` is the name of the exported variable (generally `cptable`)
- `output_file_name` is the output file (e.g. `cpexcel.js`, `cptable.js`)
- `output_file_name` is the output file (`cpexcel.js`, `cptable.js`, ...)
- `path_to_manifest` is the path to the manifest file.
The manifest file is expected to be a CSV with 3 columns:
@ -138,10 +137,10 @@ the JS source is `codepage.md`, so building is as simple as `voc codepage.md`.
## Generated Codepages
The complete list of hardcoded codepages can be found in the file `pages.csv`.
The complete list of codepages can be found in the file `pages.csv`.
Some codepages are easier to implement algorithmically. Since these are
hardcoded in `utils`, there is no corresponding entry (they are "magic").
Some codepages are easier to implement algorithmically. Since those character
tables are not generated, there is no corresponding entry (they are "magic").
| CP# | Source | Description |
|--------:|:-----------:|:-----------------------------------------------------|
@ -222,7 +221,7 @@ hardcoded in `utils`, there is no corresponding entry (they are "magic").
| `12001` | magic | Unicode UTF-32, big endian byte order |
| `20000` | Windows 7 | CNS Taiwan (Chinese Traditional) |
| `20001` | Windows 7 | TCA Taiwan |
| `20002` | Windows 7 | Eten Taiwan (Chinese Traditional) |
| `20002` | Windows 7 | ETEN Taiwan (Chinese Traditional) |
| `20003` | Windows 7 | IBM5550 Taiwan |
| `20004` | Windows 7 | TeleText Taiwan |
| `20005` | Windows 7 | Wang Taiwan |
@ -299,21 +298,21 @@ hardcoded in `utils`, there is no corresponding entry (they are "magic").
| `65001` | magic | Unicode (UTF-8) |
`unicode.org` refers to the Unicode Consortium Public Mappings, a database of
various mappings between unicode characters and respective character sets. The
various mappings between Unicode characters and respective character sets. The
tables are processed by a few scripts in the build process.
`IBM` refers to the IBM coded character set database. Even though IBM uses a
different numbering scheme from Windows, the IBM numbers are used when there is
no conflict. The tables are manually generated from the symbol PDFs.
no conflict. The tables are manually generated from the symbol manifests.
`Windows 7` refers to direct inspection of Windows 7 machines using .NET class
`System.Text.Encoding`. The enclosed `MakeEncoding.cs` C# program brute-forces
code pages. MakeEncoding.cs deviates from unicode.org in some cases. When they
code pages. `MakeEncoding.cs` deviates from unicode.org in some cases. When they
map a given code to different characters, unicode.org value is used. When
unicode.org does not prescribe a value, MakeEncoding.cs value is used.
unicode.org does not prescribe a value, `MakeEncoding.cs` value is used.
`NLS` refers to the National Language Support files supplied in various versions
of Windows. In older versions of Windows (e.g. Windows 98) these files followed
of Windows. In older versions of Windows (like Windows 98) these files followed
the name pattern `CP_#.NLS`, but newer versions use the name pattern `C_#.NLS`.
## Testing

View File

@ -1,6 +1,6 @@
# Getting Codepages
The fields of the pages.csv manifest are `codepage,url,bytes` (SBCS=1, DBCS=2)
The fields of the `pages.csv` manifest are `codepage,url,bytes` (SBCS=1, DBCS=2)
```>pages.csv
37,http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/EBCDIC/CP037.TXT,1
@ -106,7 +106,7 @@ The following codepages are available in .NET on Windows:
- 10082 Croatian (Mac)
- 20000 CNS Taiwan; Chinese Traditional (CNS)
- 20001 TCA Taiwan
- 20002 Eten Taiwan; Chinese Traditional (Eten)
- 20002 ETEN Taiwan; Chinese Traditional (ETEN)
- 20003 IBM5550 Taiwan
- 20004 TeleText Taiwan
- 20005 Wang Taiwan
@ -143,8 +143,8 @@ The following codepages are available in .NET on Windows:
- 29001 Europa 3
- 38598 ISO 8859-8 Hebrew; Hebrew (ISO-Logical)
- 50220 ISO 2022 Japanese with no halfwidth Katakana; Japanese (JIS)
- 50221 ISO 2022 Japanese with halfwidth Katakana; Japanese (JIS-Allow 1 byte Kana)
- 50222 ISO 2022 Japanese JIS X 0201-1989; Japanese (JIS-Allow 1 byte Kana - SO/SI)
- 50221 ISO 2022 Japanese with halfwidth Katakana; Japanese (JIS Allow 1 byte Kana)
- 50222 ISO 2022 Japanese JIS X 0201-1989; Japanese (JIS Allow 1 byte Kana - SO/SI)
- 50225 ISO 2022 Korean
- 50227 ISO 2022 Simplified Chinese; Chinese Simplified (ISO 2022)
- 51932 EUC Japanese
@ -267,7 +267,7 @@ The following codepages are dependencies for Visual FoxPro:
## Building Notes
The script `make.sh` (described later) will get these files and massage the data
(printing code-unicode pairs). The eventual tables are dropped in the paths
(printing code-Unicode pairs). The eventual tables are dropped in the paths
`./codepages/<CODEPAGE>.TBL`. For example, the last 10 lines of `10000.TBL` are
```>
@ -283,13 +283,13 @@ The script `make.sh` (described later) will get these files and massage the data
0xFF 0x02C7
```
which implies that code 0xF6 is `String.fromCharCode(0x02C6)` and vice versa.
which implies that code `0xF6` is `String.fromCharCode(0x02C6)` and vice versa.
## Windows-dependent build step
To build the sources on windows, consult `dotnet/MakeEncoding.cs`.
After saving the standard output to `out`, a simple awk script (`dotnet.sh`) takes care of the rest:
After saving the standard output to `out`, a simple script processes the result:
```>dotnet.sh
#!/bin/bash
@ -325,7 +325,7 @@ var y/*:Array<Array<number> >*/ = x.split("\n").map(function(z/*:string*/)/*:Arr
```
The DBCS and SBCS code generation strategies are different. The maximum code is
used to distinguish (max 0xFF for SBCS).
used to distinguish (max `0xFF` for SBCS).
```
for(i = 0; i != y.length; ++i) if(y[i][0] > maxcp) maxcp = y[i][0];
@ -341,7 +341,7 @@ if(maxcp < 256) {
/*:: if(Array.isArray(dec)) { */
```
The unicode character `0xFFFD` (REPLACEMENT CHARACTER) is used as a placeholder
The Unicode character `0xFFFD` (REPLACEMENT CHARACTER) is used as a placeholder
for characters that are not specified in the map (for example, `0xF0` is not in
code page 10000).
@ -356,7 +356,7 @@ The `dec` field is merely a split of the string, and `enc` is an eversion:
} else {
```
DBCS is similar, except that the space is sliced into 256-byte chunks (strings
DBCS is similar, except that the space is sliced in chunks of 256 bytes (strings
are only generated for those high-bytes represented in the codepage).
The strategy is to construct an array-of-arrays so that `dd[high][low]` is the
@ -384,9 +384,9 @@ process.stdout.write(jsvar + "[" + cp + "] = " + outstr + "\n");
```
`make.sh` generates the tables used by `make.njs`. The raw unicode TXT files
`make.sh` generates the tables used by `make.njs`. The raw Unicode TXT files
are columnar: `code unicode #comments`. For example, the last 10 lines of the
text file ROMAN.TXT (for CP 10000) are:
text file `ROMAN.TXT` (for CP 10000) are:
```>
0xF6 0x02C6 #MODIFIER LETTER CIRCUMFLEX ACCENT
@ -427,6 +427,7 @@ awk -F, '{print $1, $2, $3}' $INFILE | while read cp url cptype; do
sed 's/"\([0-9]+\)":/\1:/g' <bits/$cp.js.tmp >bits/$cp.js
rm -f bits/$cp.js.tmp
done
echo "// eslint-disable-next-line no-undef" >> $OUTFILE.tmp
echo "if (typeof module !== 'undefined' && module.exports && typeof DO_NOT_EXPORT_CODEPAGE === 'undefined') module.exports = $JSVAR;" >> $OUTFILE.tmp
sed 's/"\([0-9]+\)":/\1:/g' <$OUTFILE.tmp >$OUTFILE
rm -f $OUTFILE.tmp
@ -434,7 +435,7 @@ rm -f $OUTFILE.tmp
## Utilities
The encode and decode functions are kept in a separate script (cputils.js).
The encode and decode functions are kept in a separate script (`cputils.js`).
Both encode and decode deal with data represented as:
@ -447,7 +448,7 @@ while the input format is automatically determined.
# Tests
The tests include JS validity tests (requiring or eval'ing code):
The tests include JS validity tests (requiring or evaluating code):
```>test.js
var fs = require('fs'), assert = require('assert'), vm = require('vm');
@ -639,7 +640,7 @@ function testfile(f,cp,type,skip) {
}
```
The `utf8` tests verify utf8 encoding of the actual JS sources:
The `utf8` tests verify UTF-8 encoding of the actual JS sources:
```>test.js
describe('node natives', function() {
@ -665,7 +666,7 @@ describe('node natives', function() {
});
```
The utf* and ascii tests attempt to test other magic formats:
The `utf*` and `ascii` tests attempt to test other magic formats:
```>test.js
var m = cptable.utils.magic;
@ -753,41 +754,64 @@ describe('failures', function() {
```json>package.json
{
"name": "codepage",
"version": "1.11.0",
"version": "1.12.0",
"author": "SheetJS",
"description": "pure-JS library to handle codepages",
"keywords": [ "codepage", "iconv", "convert", "strings" ],
"bin": {
"codepage": "./bin/codepage.njs"
},
"files": [
"LICENSE",
"README.md",
"bin",
"cptable.js",
"cputils.js",
"dist/cpexcel.full.js"
],
"main": "cputils.js",
"types": "types",
"browser": {
"buffer": "false"
},
"dependencies": {
"voc":"~1.0.0",
"exit-on-epipe":"~1.0.1",
"commander":"~2.11.0"
"commander": "~2.11.0",
"exit-on-epipe": "~1.0.1",
"voc": "~1.0.0"
},
"devDependencies": {
"mocha":"~2.5.3"
"mocha": "~2.5.3",
"blanket": "~1.2.3",
"@sheetjs/uglify-js": "~2.7.3",
"@types/node": "^8.0.7",
"@types/commander": "^2.9.0",
"dtslint": "^0.1.2",
"typescript": "2.2.0"
},
"repository": { "type":"git", "url":"git://github.com/SheetJS/js-codepage.git"},
"scripts": {
"pretest": "git submodule init && git submodule update",
"test": "make test",
"build": "make js"
"build": "make js",
"lint": "make fullint",
"dtslint": "dtslint types"
},
"config": {
"blanket": {
"pattern": "[cputils.js]"
}
},
"alex": {
"allow": [
"chinese",
"european",
"german",
"japanese",
"latin"
]
},
"homepage": "http://sheetjs.com/opensource",
"files": [
"LICENSE",
"README.md",
"bin",
"cptable.js",
"cputils.js",
"dist/sbcs.full.js",
"dist/cpexcel.full.js"
],
"bugs": { "url": "https://github.com/SheetJS/js-codepage/issues" },
"license": "Apache-2.0",
"engines": { "node": ">=0.8" }

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,6 +1,6 @@
+ACM Getting Codepages
The fields of the pages.csv manifest are +AGA-codepage,url,bytes+AGA (SBCS+AD0-1, DBCS+AD0-2)
The fields of the +AGA-pages.csv+AGA manifest are +AGA-codepage,url,bytes+AGA (SBCS+AD0-1, DBCS+AD0-2)
+AGAAYABgAD4-pages.csv
37,http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/EBCDIC/CP037.TXT,1
@ -106,7 +106,7 @@ The following codepages are available in .NET on Windows:
- 10082 Croatian (Mac)
- 20000 CNS Taiwan+ADs Chinese Traditional (CNS)
- 20001 TCA Taiwan
- 20002 Eten Taiwan+ADs Chinese Traditional (Eten)
- 20002 ETEN Taiwan+ADs Chinese Traditional (ETEN)
- 20003 IBM5550 Taiwan
- 20004 TeleText Taiwan
- 20005 Wang Taiwan
@ -143,8 +143,8 @@ The following codepages are available in .NET on Windows:
- 29001 Europa 3
- 38598 ISO 8859-8 Hebrew+ADs Hebrew (ISO-Logical)
- 50220 ISO 2022 Japanese with no halfwidth Katakana+ADs Japanese (JIS)
- 50221 ISO 2022 Japanese with halfwidth Katakana+ADs Japanese (JIS-Allow 1 byte Kana)
- 50222 ISO 2022 Japanese JIS X 0201-1989+ADs Japanese (JIS-Allow 1 byte Kana - SO/SI)
- 50221 ISO 2022 Japanese with halfwidth Katakana+ADs Japanese (JIS Allow 1 byte Kana)
- 50222 ISO 2022 Japanese JIS X 0201-1989+ADs Japanese (JIS Allow 1 byte Kana - SO/SI)
- 50225 ISO 2022 Korean
- 50227 ISO 2022 Simplified Chinese+ADs Chinese Simplified (ISO 2022)
- 51932 EUC Japanese
@ -267,7 +267,7 @@ The following codepages are dependencies for Visual FoxPro:
+ACMAIw Building Notes
The script +AGA-make.sh+AGA (described later) will get these files and massage the data
(printing code-unicode pairs). The eventual tables are dropped in the paths
(printing code-Unicode pairs). The eventual tables are dropped in the paths
+AGA./codepages/+ADw-CODEPAGE+AD4.TBL+AGA. For example, the last 10 lines of +AGA-10000.TBL+AGA are
+AGAAYABgAD4
@ -283,13 +283,13 @@ The script +AGA-make.sh+AGA (described later) will get these files and massage t
0xFF 0x02C7
+AGAAYABg
which implies that code 0xF6 is +AGA-String.fromCharCode(0x02C6)+AGA and vice versa.
which implies that code +AGA-0xF6+AGA is +AGA-String.fromCharCode(0x02C6)+AGA and vice versa.
+ACMAIw Windows-dependent build step
To build the sources on windows, consult +AGA-dotnet/MakeEncoding.cs+AGA.
After saving the standard output to +AGA-out+AGA, a simple awk script (+AGA-dotnet.sh+AGA) takes care of the rest:
After saving the standard output to +AGA-out+AGA, a simple script processes the result:
+AGAAYABgAD4-dotnet.sh
+ACMAIQ-/bin/bash
@ -325,7 +325,7 @@ var y/+ACo:Array+ADw-Array+ADw-number+AD4 +AD4AKg-/ +AD0 x.split(+ACIAXA-n+ACI).
+AGAAYABg
The DBCS and SBCS code generation strategies are different. The maximum code is
used to distinguish (max 0xFF for SBCS).
used to distinguish (max +AGA-0xFF+AGA for SBCS).
+AGAAYABg
for(i +AD0 0+ADs i +ACEAPQ y.length+ADs +-+-i) if(y+AFs-i+AF0AWw-0+AF0 +AD4 maxcp) maxcp +AD0 y+AFs-i+AF0AWw-0+AF0AOw
@ -341,7 +341,7 @@ if(maxcp +ADw 256) +AHs
/+ACo:: if(Array.isArray(dec)) +AHs +ACo-/
+AGAAYABg
The unicode character +AGA-0xFFFD+AGA (REPLACEMENT CHARACTER) is used as a placeholder
The Unicode character +AGA-0xFFFD+AGA (REPLACEMENT CHARACTER) is used as a placeholder
for characters that are not specified in the map (for example, +AGA-0xF0+AGA is not in
code page 10000).
@ -356,7 +356,7 @@ The +AGA-dec+AGA field is merely a split of the string, and +AGA-enc+AGA is an e
+AH0 else +AHs
+AGAAYABg
DBCS is similar, except that the space is sliced into 256-byte chunks (strings
DBCS is similar, except that the space is sliced in chunks of 256 bytes (strings
are only generated for those high-bytes represented in the codepage).
The strategy is to construct an array-of-arrays so that +AGA-dd+AFs-high+AF0AWw-low+AF0AYA is the
@ -384,9 +384,9 @@ process.stdout.write(jsvar +- +ACIAWwAi +- cp +- +ACIAXQ +AD0 +ACI +- outstr +-
+AGAAYABg
+AGA-make.sh+AGA generates the tables used by +AGA-make.njs+AGA. The raw unicode TXT files
+AGA-make.sh+AGA generates the tables used by +AGA-make.njs+AGA. The raw Unicode TXT files
are columnar: +AGA-code unicode +ACM-comments+AGA. For example, the last 10 lines of the
text file ROMAN.TXT (for CP 10000) are:
text file +AGA-ROMAN.TXT+AGA (for CP 10000) are:
+AGAAYABgAD4
0xF6 0x02C6 +ACM-MODIFIER LETTER CIRCUMFLEX ACCENT
@ -427,6 +427,7 @@ awk -F, '+AHs-print +ACQ-1, +ACQ-2, +ACQ-3+AH0' +ACQ-INFILE +AHw while read cp u
sed 's/+ACIAXA(+AFs-0-9+AF0AKwBc)+ACI:/+AFw-1:/g' +ADw-bits/+ACQ-cp.js.tmp +AD4-bits/+ACQ-cp.js
rm -f bits/+ACQ-cp.js.tmp
done
echo +ACI-// eslint-disable-next-line no-undef+ACI +AD4APg +ACQ-OUTFILE.tmp
echo +ACI-if (typeof module +ACEAPQA9 'undefined' +ACYAJg module.exports +ACYAJg typeof DO+AF8-NOT+AF8-EXPORT+AF8-CODEPAGE +AD0APQA9 'undefined') module.exports +AD0 +ACQ-JSVAR+ADsAIg +AD4APg +ACQ-OUTFILE.tmp
sed 's/+ACIAXA(+AFs-0-9+AF0AKwBc)+ACI:/+AFw-1:/g' +ADwAJA-OUTFILE.tmp +AD4AJA-OUTFILE
rm -f +ACQ-OUTFILE.tmp
@ -434,7 +435,7 @@ rm -f +ACQ-OUTFILE.tmp
+ACMAIw Utilities
The encode and decode functions are kept in a separate script (cputils.js).
The encode and decode functions are kept in a separate script (+AGA-cputils.js+AGA).
Both encode and decode deal with data represented as:
@ -447,7 +448,7 @@ while the input format is automatically determined.
+ACM Tests
The tests include JS validity tests (requiring or eval'ing code):
The tests include JS validity tests (requiring or evaluating code):
+AGAAYABgAD4-test.js
var fs +AD0 require('fs'), assert +AD0 require('assert'), vm +AD0 require('vm')+ADs
@ -639,7 +640,7 @@ function testfile(f,cp,type,skip) +AHs
+AH0
+AGAAYABg
The +AGA-utf8+AGA tests verify utf8 encoding of the actual JS sources:
The +AGA-utf8+AGA tests verify UTF-8 encoding of the actual JS sources:
+AGAAYABgAD4-test.js
describe('node natives', function() +AHs
@ -665,7 +666,7 @@ describe('node natives', function() +AHs
+AH0)+ADs
+AGAAYABg
The utf+ACo and ascii tests attempt to test other magic formats:
The +AGA-utf+ACoAYA and +AGA-ascii+AGA tests attempt to test other magic formats:
+AGAAYABgAD4-test.js
var m +AD0 cptable.utils.magic+ADs
@ -753,41 +754,64 @@ describe('failures', function() +AHs
+AGAAYABg-json+AD4-package.json
+AHs
+ACI-name+ACI: +ACI-codepage+ACI,
+ACI-version+ACI: +ACI-1.11.0+ACI,
+ACI-version+ACI: +ACI-1.12.0+ACI,
+ACI-author+ACI: +ACI-SheetJS+ACI,
+ACI-description+ACI: +ACI-pure-JS library to handle codepages+ACI,
+ACI-keywords+ACI: +AFs +ACI-codepage+ACI, +ACI-iconv+ACI, +ACI-convert+ACI, +ACI-strings+ACI +AF0,
+ACI-bin+ACI: +AHs
+ACI-codepage+ACI: +ACI./bin/codepage.njs+ACI
+AH0,
+ACI-files+ACI: +AFs
+ACI-LICENSE+ACI,
+ACI-README.md+ACI,
+ACI-bin+ACI,
+ACI-cptable.js+ACI,
+ACI-cputils.js+ACI,
+ACI-dist/cpexcel.full.js+ACI
+AF0,
+ACI-main+ACI: +ACI-cputils.js+ACI,
+ACI-types+ACI: +ACI-types+ACI,
+ACI-browser+ACI: +AHs
+ACI-buffer+ACI: +ACI-false+ACI
+AH0,
+ACI-dependencies+ACI: +AHs
+ACI-voc+ACI:+ACIAfg-1.0.0+ACI,
+ACI-exit-on-epipe+ACI:+ACIAfg-1.0.1+ACI,
+ACI-commander+ACI:+ACIAfg-2.11.0+ACI
+ACI-commander+ACI: +ACIAfg-2.11.0+ACI,
+ACI-exit-on-epipe+ACI: +ACIAfg-1.0.1+ACI,
+ACI-voc+ACI: +ACIAfg-1.0.0+ACI
+AH0,
+ACI-devDependencies+ACI: +AHs
+ACI-mocha+ACI:+ACIAfg-2.5.3+ACI
+ACI-mocha+ACI: +ACIAfg-2.5.3+ACI,
+ACI-blanket+ACI: +ACIAfg-1.2.3+ACI,
+ACIAQA-sheetjs/uglify-js+ACI: +ACIAfg-2.7.3+ACI,
+ACIAQA-types/node+ACI: +ACIAXg-8.0.7+ACI,
+ACIAQA-types/commander+ACI: +ACIAXg-2.9.0+ACI,
+ACI-dtslint+ACI: +ACIAXg-0.1.2+ACI,
+ACI-typescript+ACI: +ACI-2.2.0+ACI
+AH0,
+ACI-repository+ACI: +AHs +ACI-type+ACI:+ACI-git+ACI, +ACI-url+ACI:+ACI-git://github.com/SheetJS/js-codepage.git+ACIAfQ,
+ACI-scripts+ACI: +AHs
+ACI-pretest+ACI: +ACI-git submodule init +ACYAJg git submodule update+ACI,
+ACI-test+ACI: +ACI-make test+ACI,
+ACI-build+ACI: +ACI-make js+ACI
+ACI-build+ACI: +ACI-make js+ACI,
+ACI-lint+ACI: +ACI-make fullint+ACI,
+ACI-dtslint+ACI: +ACI-dtslint types+ACI
+AH0,
+ACI-config+ACI: +AHs
+ACI-blanket+ACI: +AHs
+ACI-pattern+ACI: +ACIAWw-cputils.js+AF0AIg
+AH0
+AH0,
+ACI-alex+ACI: +AHs
+ACI-allow+ACI: +AFs
+ACI-chinese+ACI,
+ACI-european+ACI,
+ACI-german+ACI,
+ACI-japanese+ACI,
+ACI-latin+ACI
+AF0
+AH0,
+ACI-homepage+ACI: +ACI-http://sheetjs.com/opensource+ACI,
+ACI-files+ACI: +AFs
+ACI-LICENSE+ACI,
+ACI-README.md+ACI,
+ACI-bin+ACI,
+ACI-cptable.js+ACI,
+ACI-cputils.js+ACI,
+ACI-dist/sbcs.full.js+ACI,
+ACI-dist/cpexcel.full.js+ACI
+AF0,
+ACI-bugs+ACI: +AHs +ACI-url+ACI: +ACI-https://github.com/SheetJS/js-codepage/issues+ACI +AH0,
+ACI-license+ACI: +ACI-Apache-2.0+ACI,
+ACI-engines+ACI: +AHs +ACI-node+ACI: +ACIAPgA9-0.8+ACI +AH0

View File

@ -1,6 +1,6 @@
# Getting Codepages
The fields of the pages.csv manifest are `codepage,url,bytes` (SBCS=1, DBCS=2)
The fields of the `pages.csv` manifest are `codepage,url,bytes` (SBCS=1, DBCS=2)
```>pages.csv
37,http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/EBCDIC/CP037.TXT,1
@ -106,7 +106,7 @@ The following codepages are available in .NET on Windows:
- 10082 Croatian (Mac)
- 20000 CNS Taiwan; Chinese Traditional (CNS)
- 20001 TCA Taiwan
- 20002 Eten Taiwan; Chinese Traditional (Eten)
- 20002 ETEN Taiwan; Chinese Traditional (ETEN)
- 20003 IBM5550 Taiwan
- 20004 TeleText Taiwan
- 20005 Wang Taiwan
@ -143,8 +143,8 @@ The following codepages are available in .NET on Windows:
- 29001 Europa 3
- 38598 ISO 8859-8 Hebrew; Hebrew (ISO-Logical)
- 50220 ISO 2022 Japanese with no halfwidth Katakana; Japanese (JIS)
- 50221 ISO 2022 Japanese with halfwidth Katakana; Japanese (JIS-Allow 1 byte Kana)
- 50222 ISO 2022 Japanese JIS X 0201-1989; Japanese (JIS-Allow 1 byte Kana - SO/SI)
- 50221 ISO 2022 Japanese with halfwidth Katakana; Japanese (JIS Allow 1 byte Kana)
- 50222 ISO 2022 Japanese JIS X 0201-1989; Japanese (JIS Allow 1 byte Kana - SO/SI)
- 50225 ISO 2022 Korean
- 50227 ISO 2022 Simplified Chinese; Chinese Simplified (ISO 2022)
- 51932 EUC Japanese
@ -267,7 +267,7 @@ The following codepages are dependencies for Visual FoxPro:
## Building Notes
The script `make.sh` (described later) will get these files and massage the data
(printing code-unicode pairs). The eventual tables are dropped in the paths
(printing code-Unicode pairs). The eventual tables are dropped in the paths
`./codepages/<CODEPAGE>.TBL`. For example, the last 10 lines of `10000.TBL` are
```>
@ -283,13 +283,13 @@ The script `make.sh` (described later) will get these files and massage the data
0xFF 0x02C7
```
which implies that code 0xF6 is `String.fromCharCode(0x02C6)` and vice versa.
which implies that code `0xF6` is `String.fromCharCode(0x02C6)` and vice versa.
## Windows-dependent build step
To build the sources on windows, consult `dotnet/MakeEncoding.cs`.
After saving the standard output to `out`, a simple awk script (`dotnet.sh`) takes care of the rest:
After saving the standard output to `out`, a simple script processes the result:
```>dotnet.sh
#!/bin/bash
@ -325,7 +325,7 @@ var y/*:Array<Array<number> >*/ = x.split("\n").map(function(z/*:string*/)/*:Arr
```
The DBCS and SBCS code generation strategies are different. The maximum code is
used to distinguish (max 0xFF for SBCS).
used to distinguish (max `0xFF` for SBCS).
```
for(i = 0; i != y.length; ++i) if(y[i][0] > maxcp) maxcp = y[i][0];
@ -341,7 +341,7 @@ if(maxcp < 256) {
/*:: if(Array.isArray(dec)) { */
```
The unicode character `0xFFFD` (REPLACEMENT CHARACTER) is used as a placeholder
The Unicode character `0xFFFD` (REPLACEMENT CHARACTER) is used as a placeholder
for characters that are not specified in the map (for example, `0xF0` is not in
code page 10000).
@ -356,7 +356,7 @@ The `dec` field is merely a split of the string, and `enc` is an eversion:
} else {
```
DBCS is similar, except that the space is sliced into 256-byte chunks (strings
DBCS is similar, except that the space is sliced in chunks of 256 bytes (strings
are only generated for those high-bytes represented in the codepage).
The strategy is to construct an array-of-arrays so that `dd[high][low]` is the
@ -384,9 +384,9 @@ process.stdout.write(jsvar + "[" + cp + "] = " + outstr + "\n");
```
`make.sh` generates the tables used by `make.njs`. The raw unicode TXT files
`make.sh` generates the tables used by `make.njs`. The raw Unicode TXT files
are columnar: `code unicode #comments`. For example, the last 10 lines of the
text file ROMAN.TXT (for CP 10000) are:
text file `ROMAN.TXT` (for CP 10000) are:
```>
0xF6 0x02C6 #MODIFIER LETTER CIRCUMFLEX ACCENT
@ -427,6 +427,7 @@ awk -F, '{print $1, $2, $3}' $INFILE | while read cp url cptype; do
sed 's/"\([0-9]+\)":/\1:/g' <bits/$cp.js.tmp >bits/$cp.js
rm -f bits/$cp.js.tmp
done
echo "// eslint-disable-next-line no-undef" >> $OUTFILE.tmp
echo "if (typeof module !== 'undefined' && module.exports && typeof DO_NOT_EXPORT_CODEPAGE === 'undefined') module.exports = $JSVAR;" >> $OUTFILE.tmp
sed 's/"\([0-9]+\)":/\1:/g' <$OUTFILE.tmp >$OUTFILE
rm -f $OUTFILE.tmp
@ -434,7 +435,7 @@ rm -f $OUTFILE.tmp
## Utilities
The encode and decode functions are kept in a separate script (cputils.js).
The encode and decode functions are kept in a separate script (`cputils.js`).
Both encode and decode deal with data represented as:
@ -447,7 +448,7 @@ while the input format is automatically determined.
# Tests
The tests include JS validity tests (requiring or eval'ing code):
The tests include JS validity tests (requiring or evaluating code):
```>test.js
var fs = require('fs'), assert = require('assert'), vm = require('vm');
@ -639,7 +640,7 @@ function testfile(f,cp,type,skip) {
}
```
The `utf8` tests verify utf8 encoding of the actual JS sources:
The `utf8` tests verify UTF-8 encoding of the actual JS sources:
```>test.js
describe('node natives', function() {
@ -665,7 +666,7 @@ describe('node natives', function() {
});
```
The utf* and ascii tests attempt to test other magic formats:
The `utf*` and `ascii` tests attempt to test other magic formats:
```>test.js
var m = cptable.utils.magic;
@ -753,41 +754,64 @@ describe('failures', function() {
```json>package.json
{
"name": "codepage",
"version": "1.11.0",
"version": "1.12.0",
"author": "SheetJS",
"description": "pure-JS library to handle codepages",
"keywords": [ "codepage", "iconv", "convert", "strings" ],
"bin": {
"codepage": "./bin/codepage.njs"
},
"files": [
"LICENSE",
"README.md",
"bin",
"cptable.js",
"cputils.js",
"dist/cpexcel.full.js"
],
"main": "cputils.js",
"types": "types",
"browser": {
"buffer": "false"
},
"dependencies": {
"voc":"~1.0.0",
"exit-on-epipe":"~1.0.1",
"commander":"~2.11.0"
"commander": "~2.11.0",
"exit-on-epipe": "~1.0.1",
"voc": "~1.0.0"
},
"devDependencies": {
"mocha":"~2.5.3"
"mocha": "~2.5.3",
"blanket": "~1.2.3",
"@sheetjs/uglify-js": "~2.7.3",
"@types/node": "^8.0.7",
"@types/commander": "^2.9.0",
"dtslint": "^0.1.2",
"typescript": "2.2.0"
},
"repository": { "type":"git", "url":"git://github.com/SheetJS/js-codepage.git"},
"scripts": {
"pretest": "git submodule init && git submodule update",
"test": "make test",
"build": "make js"
"build": "make js",
"lint": "make fullint",
"dtslint": "dtslint types"
},
"config": {
"blanket": {
"pattern": "[cputils.js]"
}
},
"alex": {
"allow": [
"chinese",
"european",
"german",
"japanese",
"latin"
]
},
"homepage": "http://sheetjs.com/opensource",
"files": [
"LICENSE",
"README.md",
"bin",
"cptable.js",
"cputils.js",
"dist/sbcs.full.js",
"dist/cpexcel.full.js"
],
"bugs": { "url": "https://github.com/SheetJS/js-codepage/issues" },
"license": "Apache-2.0",
"engines": { "node": ">=0.8" }

View File

@ -1,6 +1,6 @@
# Getting Codepages
The fields of the pages.csv manifest are `codepage,url,bytes` (SBCS=1, DBCS=2)
The fields of the `pages.csv` manifest are `codepage,url,bytes` (SBCS=1, DBCS=2)
```>pages.csv
37,http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/EBCDIC/CP037.TXT,1
@ -15,4 +15,3 @@ The fields of the pages.csv manifest are `codepage,url,bytes` (SBCS=1, DBCS=2)
860,http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/PC/CP860.TXT,1
861,http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/PC/CP861.TXT,1
862,http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/PC/CP862.TXT,1
86

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,6 +1,6 @@
+ACM Getting Codepages
The fields of the pages.csv manifest are +AGA-codepage,url,bytes+AGA (SBCS+AD0-1, DBCS+AD0-2)
The fields of the +AGA-pages.csv+AGA manifest are +AGA-codepage,url,bytes+AGA (SBCS+AD0-1, DBCS+AD0-2)
+AGAAYABgAD4-pages.csv
37,http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/EBCDIC/CP037.TXT,1
@ -15,4 +15,3 @@ The fields of the pages.csv manifest are +AGA-codepage,url,bytes+AGA (SBCS+AD0-1
860,http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/PC/CP860.TXT,1
861,http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/PC/CP861.TXT,1
862,http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/PC/CP862.TXT,1
86

View File

@ -1,6 +1,6 @@
# Getting Codepages
The fields of the pages.csv manifest are `codepage,url,bytes` (SBCS=1, DBCS=2)
The fields of the `pages.csv` manifest are `codepage,url,bytes` (SBCS=1, DBCS=2)
```>pages.csv
37,http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/EBCDIC/CP037.TXT,1
@ -15,4 +15,3 @@ The fields of the pages.csv manifest are `codepage,url,bytes` (SBCS=1, DBCS=2)
860,http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/PC/CP860.TXT,1
861,http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/PC/CP861.TXT,1
862,http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/PC/CP862.TXT,1
86

View File

@ -1,6 +1,6 @@
/* cptable.js (C) 2013-present SheetJS -- http://sheetjs.com */
/*jshint -W100 */
var cptable = {version:"1.11.0"};
var cptable = {version:"1.12.0"};
cptable[37] = (function(){ var d = "\u0000\u0001\u0002\u0003\t\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\b\u0018\u0019\u001c\u001d\u001e\u001f\n\u0017\u001b\u0005\u0006\u0007\u0016\u0004\u0014\u0015\u001a .<(+|&!$*);-/,%_>?`:#@'=\"abcdefghijklmnopqr~stuvwxyz^[]{ABCDEFGHI}JKLMNOPQR\\STUVWXYZ0123456789", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
cptable[437] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
cptable[500] = (function(){ var d = "\u0000\u0001\u0002\u0003\t\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\b\u0018\u0019\u001c\u001d\u001e\u001f\n\u0017\u001b\u0005\u0006\u0007\u0016\u0004\u0014\u0015\u001a [.<(+!&]$*);^-/,%_>?`:#@'=\"abcdefghijklmnopqr~stuvwxyz|{ABCDEFGHI}JKLMNOPQR\\STUVWXYZ0123456789", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
@ -6343,4 +6343,5 @@ for(j = 0; j != D[239].length; ++j) if(D[239][j].charCodeAt(0) !== 0xFFFD) { e[D
return {"enc": e, "dec": d }; })();
cptable[620] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
cptable[895] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
// eslint-disable-next-line no-undef
if (typeof module !== 'undefined' && module.exports && typeof DO_NOT_EXPORT_CODEPAGE === 'undefined') module.exports = cptable;

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,6 +1,6 @@
/+ACo cptable.js (C) 2013-present SheetJS -- http://sheetjs.com +ACo-/
/+ACo-jshint -W100 +ACo-/
var cptable +AD0 +AHs-version:+ACI-1.11.0+ACIAfQA7
var cptable +AD0 +AHs-version:+ACI-1.12.0+ACIAfQA7
cptable+AFs-37+AF0 +AD0 (function()+AHs var d +AD0 +ACIAXA-u0000+AFw-u0001+AFw-u0002+AFw-u0003+AJwAXA-t+AIYAfwCXAI0AjgBc-u000b+AFw-f+AFw-r+AFw-u000e+AFw-u000f+AFw-u0010+AFw-u0011+AFw-u0012+AFw-u0013+AJ0AhQBc-b+AIcAXA-u0018+AFw-u0019+AJIAjwBc-u001c+AFw-u001d+AFw-u001e+AFw-u001f+AIAAgQCCAIMAhABc-n+AFw-u0017+AFw-u001b+AIgAiQCKAIsAjABc-u0005+AFw-u0006+AFw-u0007+AJAAkQBc-u0016+AJMAlACVAJYAXA-u0004+AJgAmQCaAJsAXA-u0014+AFw-u0015+AJ4AXA-u001a +AKAA4gDkAOAA4QDjAOUA5wDxAKI.+ADw(+-+AHwAJgDpAOoA6wDoAO0A7gDvAOwA3wAhACQAKg)+ADsArA--/+AMIAxADAAMEAwwDFAMcA0QCm,+ACUAXwA+?+APgAyQDKAMsAyADNAM4AzwDMAGA:+ACMAQA'+AD0AXAAiANg-abcdefghi+AKsAuwDwAP0A/gCxALA-jklmnopqr+AKoAugDmALgAxgCkALUAfg-stuvwxyz+AKEAvwDQAN0A3gCuAF4AowClALcAqQCnALYAvAC9AL4AWwBdAK8AqAC0ANcAew-ABCDEFGHI+AK0A9AD2APIA8wD1AH0-JKLMNOPQR+ALkA+wD8APkA+gD/AFwAXAD3-STUVWXYZ+ALIA1ADWANIA0wDV-0123456789+ALMA2wDcANkA2gCfACI, D +AD0 +AFsAXQ, e +AD0 +AHsAfQA7 for(var i+AD0-0+ADs-i+ACEAPQ-d.length+ADsAKwAr-i) +AHs if(d.charCodeAt(i) +ACEAPQA9 0xFFFD) e+AFs-d.charAt(i)+AF0 +AD0 i+ADs D+AFs-i+AF0 +AD0 d.charAt(i)+ADs +AH0 return +AHsAIg-enc+ACI: e, +ACI-dec+ACI: D +AH0AOw +AH0)()+ADs
cptable+AFs-437+AF0 +AD0 (function()+AHs var d +AD0 +ACIAXA-u0000+AFw-u0001+AFw-u0002+AFw-u0003+AFw-u0004+AFw-u0005+AFw-u0006+AFw-u0007+AFw-b+AFw-t+AFw-n+AFw-u000b+AFw-f+AFw-r+AFw-u000e+AFw-u000f+AFw-u0010+AFw-u0011+AFw-u0012+AFw-u0013+AFw-u0014+AFw-u0015+AFw-u0016+AFw-u0017+AFw-u0018+AFw-u0019+AFw-u001a+AFw-u001b+AFw-u001c+AFw-u001d+AFw-u001e+AFw-u001f +ACEAXAAiACMAJAAlACY'()+ACoAKw,-./0123456789:+ADsAPAA9AD4?+AEA-ABCDEFGHIJKLMNOPQRSTUVWXYZ+AFsAXABcAF0AXgBfAGA-abcdefghijklmnopqrstuvwxyz+AHsAfAB9AH4AfwDHAPwA6QDiAOQA4ADlAOcA6gDrAOgA7wDuAOwAxADFAMkA5gDGAPQA9gDyAPsA+QD/ANYA3ACiAKMApSCnAZIA4QDtAPMA+gDxANEAqgC6AL8jEACsAL0AvAChAKsAuyWRJZIlkyUCJSQlYSViJVYlVSVjJVElVyVdJVwlWyUQJRQlNCUsJRwlACU8JV4lXyVaJVQlaSVmJWAlUCVsJWclaCVkJWUlWSVYJVIlUyVrJWolGCUMJYglhCWMJZAlgAOxAN8DkwPAA6MDwwC1A8QDpgOYA6kDtCIeA8YDtSIpImEAsSJlImQjICMhAPciSACwIhkAtyIaIH8AsiWgAKAAIg, D +AD0 +AFsAXQ, e +AD0 +AHsAfQA7 for(var i+AD0-0+ADs-i+ACEAPQ-d.length+ADsAKwAr-i) +AHs if(d.charCodeAt(i) +ACEAPQA9 0xFFFD) e+AFs-d.charAt(i)+AF0 +AD0 i+ADs D+AFs-i+AF0 +AD0 d.charAt(i)+ADs +AH0 return +AHsAIg-enc+ACI: e, +ACI-dec+ACI: D +AH0AOw +AH0)()+ADs
cptable+AFs-500+AF0 +AD0 (function()+AHs var d +AD0 +ACIAXA-u0000+AFw-u0001+AFw-u0002+AFw-u0003+AJwAXA-t+AIYAfwCXAI0AjgBc-u000b+AFw-f+AFw-r+AFw-u000e+AFw-u000f+AFw-u0010+AFw-u0011+AFw-u0012+AFw-u0013+AJ0AhQBc-b+AIcAXA-u0018+AFw-u0019+AJIAjwBc-u001c+AFw-u001d+AFw-u001e+AFw-u001f+AIAAgQCCAIMAhABc-n+AFw-u0017+AFw-u001b+AIgAiQCKAIsAjABc-u0005+AFw-u0006+AFw-u0007+AJAAkQBc-u0016+AJMAlACVAJYAXA-u0004+AJgAmQCaAJsAXA-u0014+AFw-u0015+AJ4AXA-u001a +AKAA4gDkAOAA4QDjAOUA5wDxAFs.+ADw(+-+ACEAJgDpAOoA6wDoAO0A7gDvAOwA3wBdACQAKg)+ADsAXg--/+AMIAxADAAMEAwwDFAMcA0QCm,+ACUAXwA+?+APgAyQDKAMsAyADNAM4AzwDMAGA:+ACMAQA'+AD0AXAAiANg-abcdefghi+AKsAuwDwAP0A/gCxALA-jklmnopqr+AKoAugDmALgAxgCkALUAfg-stuvwxyz+AKEAvwDQAN0A3gCuAKIAowClALcAqQCnALYAvAC9AL4ArAB8AK8AqAC0ANcAew-ABCDEFGHI+AK0A9AD2APIA8wD1AH0-JKLMNOPQR+ALkA+wD8APkA+gD/AFwAXAD3-STUVWXYZ+ALIA1ADWANIA0wDV-0123456789+ALMA2wDcANkA2gCfACI, D +AD0 +AFsAXQ, e +AD0 +AHsAfQA7 for(var i+AD0-0+ADs-i+ACEAPQ-d.length+ADsAKwAr-i) +AHs if(d.charCodeAt(i) +ACEAPQA9 0xFFFD) e+AFs-d.charAt(i)+AF0 +AD0 i+ADs D+AFs-i+AF0 +AD0 d.charAt(i)+ADs +AH0 return +AHsAIg-enc+ACI: e, +ACI-dec+ACI: D +AH0AOw +AH0)()+ADs
@ -6343,4 +6343,5 @@ for(j +AD0 0+ADs j +ACEAPQ D+AFs-239+AF0.length+ADs +-+-j) if(D+AFs-239+AF0AWw-j
return +AHsAIg-enc+ACI: e, +ACI-dec+ACI: d +AH0AOw +AH0)()+ADs
cptable+AFs-620+AF0 +AD0 (function()+AHs var d +AD0 +ACIAXA-u0000+AFw-u0001+AFw-u0002+AFw-u0003+AFw-u0004+AFw-u0005+AFw-u0006+AFw-u0007+AFw-b+AFw-t+AFw-n+AFw-u000b+AFw-f+AFw-r+AFw-u000e+AFw-u000f+AFw-u0010+AFw-u0011+AFw-u0012+AFw-u0013+AFw-u0014+AFw-u0015+AFw-u0016+AFw-u0017+AFw-u0018+AFw-u0019+AFw-u001a+AFw-u001b+AFw-u001c+AFw-u001d+AFw-u001e+AFw-u001f +ACEAXAAiACMAJAAlACY'()+ACoAKw,-./0123456789:+ADsAPAA9AD4?+AEA-ABCDEFGHIJKLMNOPQRSTUVWXYZ+AFsAXABcAF0AXgBfAGA-abcdefghijklmnopqrstuvwxyz+AHsAfAB9AH4AfwDHAPwA6QDiAOQA4AEFAOcA6gDrAOgA7wDuAQcAxAEEARgBGQFCAPQA9gEGAPsA+QFaANYA3ACiAUEApQFbAZIBeQF7APMA0wFEAUMBegF8AL8jEACsAL0AvAChAKsAuyWRJZIlkyUCJSQlYSViJVYlVSVjJVElVyVdJVwlWyUQJRQlNCUsJRwlACU8JV4lXyVaJVQlaSVmJWAlUCVsJWclaCVkJWUlWSVYJVIlUyVrJWolGCUMJYglhCWMJZAlgAOxAN8DkwPAA6MDwwC1A8QDpgOYA6kDtCIeA8YDtSIpImEAsSJlImQjICMhAPciSACwIhkAtyIaIH8AsiWgAKAAIg, D +AD0 +AFsAXQ, e +AD0 +AHsAfQA7 for(var i+AD0-0+ADs-i+ACEAPQ-d.length+ADsAKwAr-i) +AHs if(d.charCodeAt(i) +ACEAPQA9 0xFFFD) e+AFs-d.charAt(i)+AF0 +AD0 i+ADs D+AFs-i+AF0 +AD0 d.charAt(i)+ADs +AH0 return +AHsAIg-enc+ACI: e, +ACI-dec+ACI: D +AH0AOw +AH0)()+ADs
cptable+AFs-895+AF0 +AD0 (function()+AHs var d +AD0 +ACIAXA-u0000+AFw-u0001+AFw-u0002+AFw-u0003+AFw-u0004+AFw-u0005+AFw-u0006+AFw-u0007+AFw-b+AFw-t+AFw-n+AFw-u000b+AFw-f+AFw-r+AFw-u000e+AFw-u000f+AFw-u0010+AFw-u0011+AFw-u0012+AFw-u0013+AFw-u0014+AFw-u0015+AFw-u0016+AFw-u0017+AFw-u0018+AFw-u0019+AFw-u001a+AFw-u001b+AFw-u001c+AFw-u001d+AFw-u001e+AFw-u001f +ACEAXAAiACMAJAAlACY'()+ACoAKw,-./0123456789:+ADsAPAA9AD4?+AEA-ABCDEFGHIJKLMNOPQRSTUVWXYZ+AFsAXABcAF0AXgBfAGA-abcdefghijklmnopqrstuvwxyz+AHsAfAB9AH4AfwEMAPwA6QEPAOQBDgFkAQ0BGwEaATkAzQE+AeoAxADBAMkBfgF9APQA9gDTAW8A2gD9ANYA3AFgAT0A3QFYAWUA4QDtAPMA+gFIAUcBbgDUAWEBWQFVAVQAvACnAKsAuyWRJZIlkyUCJSQlYSViJVYlVSVjJVElVyVdJVwlWyUQJRQlNCUsJRwlACU8JV4lXyVaJVQlaSVmJWAlUCVsJWclaCVkJWUlWSVYJVIlUyVrJWolGCUMJYglhCWMJZAlgAOxAN8DkwPAA6MDwwC1A8QDpgOYA6kDtCIeA8YDtSIpImEAsSJlImQjICMhAPciSACwIhkAtyIaIH8AsiWgAKAAIg, D +AD0 +AFsAXQ, e +AD0 +AHsAfQA7 for(var i+AD0-0+ADs-i+ACEAPQ-d.length+ADsAKwAr-i) +AHs if(d.charCodeAt(i) +ACEAPQA9 0xFFFD) e+AFs-d.charAt(i)+AF0 +AD0 i+ADs D+AFs-i+AF0 +AD0 d.charAt(i)+ADs +AH0 return +AHsAIg-enc+ACI: e, +ACI-dec+ACI: D +AH0AOw +AH0)()+ADs
// eslint-disable-next-line no-undef
if (typeof module +ACEAPQA9 'undefined' +ACYAJg module.exports +ACYAJg typeof DO+AF8-NOT+AF8-EXPORT+AF8-CODEPAGE +AD0APQA9 'undefined') module.exports +AD0 cptable+ADs

View File

@ -1,6 +1,6 @@
/* cptable.js (C) 2013-present SheetJS -- http://sheetjs.com */
/*jshint -W100 */
var cptable = {version:"1.11.0"};
var cptable = {version:"1.12.0"};
cptable[37] = (function(){ var d = "\u0000\u0001\u0002\u0003œ\t†—Ž\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013…\b‡\u0018\u0019’\u001c\u001d\u001e\u001f€‚ƒ„\n\u0017\u001bˆ‰Š‹Œ\u0005\u0006\u0007‘\u0016“”•–\u0004˜™š›\u0014\u0015ž\u001a  âäàáãåçñ¢.<(+|&éêëèíîïìß!$*);¬-/ÂÄÀÁÃÅÇѦ,%_>?øÉÊËÈÍÎÏÌ`:#@'=\"Øabcdefghi«»ðýþ±°jklmnopqrªºæ¸Æ¤µ~stuvwxyz¡¿ÐÝÞ®^£¥·©§¶¼½¾[]¯¨´×{ABCDEFGHI­ôöòóõ}JKLMNOPQR¹ûüùúÿ\\÷STUVWXYZ²ÔÖÒÓÕ0123456789³ÛÜÙڟ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
cptable[437] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
cptable[500] = (function(){ var d = "\u0000\u0001\u0002\u0003œ\t†—Ž\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013…\b‡\u0018\u0019’\u001c\u001d\u001e\u001f€‚ƒ„\n\u0017\u001bˆ‰Š‹Œ\u0005\u0006\u0007‘\u0016“”•–\u0004˜™š›\u0014\u0015ž\u001a  âäàáãåçñ[.<(+!&éêëèíîïìß]$*);^-/ÂÄÀÁÃÅÇѦ,%_>?øÉÊËÈÍÎÏÌ`:#@'=\"Øabcdefghi«»ðýþ±°jklmnopqrªºæ¸Æ¤µ~stuvwxyz¡¿ÐÝÞ®¢£¥·©§¶¼½¾¬|¯¨´×{ABCDEFGHI­ôöòóõ}JKLMNOPQR¹ûüùúÿ\\÷STUVWXYZ²ÔÖÒÓÕ0123456789³ÛÜÙڟ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
@ -6343,4 +6343,5 @@ for(j = 0; j != D[239].length; ++j) if(D[239][j].charCodeAt(0) !== 0xFFFD) { e[D
return {"enc": e, "dec": d }; })();
cptable[620] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÇüéâäàąçêëèïîćÄĄĘęłôöĆûùŚÖÜ¢Ł¥śƒŹŻóÓńŃźż¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
cptable[895] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ČüéďäĎŤčěĚĹÍľǪÄÁÉžŽôöÓůÚýÖÜŠĽÝŘťáíóúňŇŮÔšřŕŔ¼§«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
// eslint-disable-next-line no-undef
if (typeof module !== 'undefined' && module.exports && typeof DO_NOT_EXPORT_CODEPAGE === 'undefined') module.exports = cptable;

View File

@ -2,6 +2,8 @@
/* vim: set ft=javascript: */
/*jshint newcap: false */
(function(root, factory) {
/*jshint ignore:start */
/*eslint-disable */
"use strict";
if(typeof cptable === "undefined") {
if(typeof require !== "undefined"){
@ -10,8 +12,11 @@
else root.cptable = factory(cpt);
} else throw new Error("cptable not found");
} else cptable = factory(cptable);
/*eslint-enable */
/*jshint ignore:end */
}(this, function(cpt){
"use strict";
/*global module, Buffer */
var magic = {
"1200":"utf16le",
"1201":"utf16be",
@ -265,7 +270,7 @@
}
}
};
var null_enc = function(data, ofmt) { return ""; };
var null_enc = function(data, ofmt) { void ofmt; return ""; };
var cp_decache = function cp_decache(cp) { delete cpdcache[cp]; delete cpecache[cp]; };
var decache = function decache() {
if(has_buf) {
@ -479,6 +484,7 @@
if(data[i] !== 0x2b) { j=1; out[k++] = String.fromCharCode(data[i]); continue; }
j=1;
if(data[i+1] === 0x2d) { j = 2; out[k++] = "+"; continue; }
// eslint-disable-next-line no-useless-escape
while(String.fromCharCode(data[i+j]).match(/[A-Za-z0-9+\/]/)) j++;
var dash = 0;
if(data[i+j] === 0x2d) { ++j; dash=1; }

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -2,6 +2,8 @@
/+ACo vim: set ft+AD0-javascript: +ACo-/
/+ACo-jshint newcap: false +ACo-/
(function(root, factory) +AHs
/+ACo-jshint ignore:start +ACo-/
/+ACo-eslint-disable +ACo-/
+ACI-use strict+ACIAOw
if(typeof cptable +AD0APQA9 +ACI-undefined+ACI) +AHs
if(typeof require +ACEAPQA9 +ACI-undefined+ACI)+AHs
@ -10,8 +12,11 @@
else root.cptable +AD0 factory(cpt)+ADs
+AH0 else throw new Error(+ACI-cptable not found+ACI)+ADs
+AH0 else cptable +AD0 factory(cptable)+ADs
/+ACo-eslint-enable +ACo-/
/+ACo-jshint ignore:end +ACo-/
+AH0(this, function(cpt)+AHs
+ACI-use strict+ACIAOw
/+ACo-global module, Buffer +ACo-/
var magic +AD0 +AHs
+ACI-1200+ACI:+ACI-utf16le+ACI,
+ACI-1201+ACI:+ACI-utf16be+ACI,
@ -265,7 +270,7 @@
+AH0
+AH0
+AH0AOw
var null+AF8-enc +AD0 function(data, ofmt) +AHs return +ACIAIgA7 +AH0AOw
var null+AF8-enc +AD0 function(data, ofmt) +AHs void ofmt+ADs return +ACIAIgA7 +AH0AOw
var cp+AF8-decache +AD0 function cp+AF8-decache(cp) +AHs delete cpdcache+AFs-cp+AF0AOw delete cpecache+AFs-cp+AF0AOw +AH0AOw
var decache +AD0 function decache() +AHs
if(has+AF8-buf) +AHs
@ -479,6 +484,7 @@
if(data+AFs-i+AF0 +ACEAPQA9 0x2b) +AHs j+AD0-1+ADs out+AFs-k+-+-+AF0 +AD0 String.fromCharCode(data+AFs-i+AF0)+ADs continue+ADs +AH0
j+AD0-1+ADs
if(data+AFs-i+-1+AF0 +AD0APQA9 0x2d) +AHs j +AD0 2+ADs out+AFs-k+-+-+AF0 +AD0 +ACIAKwAiADs continue+ADs +AH0
// eslint-disable-next-line no-useless-escape
while(String.fromCharCode(data+AFs-i+-j+AF0).match(/+AFs-A-Za-z0-9+-+AFw-/+AF0-/)) j+-+-+ADs
var dash +AD0 0+ADs
if(data+AFs-i+-j+AF0 +AD0APQA9 0x2d) +AHs +-+-j+ADs dash+AD0-1+ADs +AH0

View File

@ -2,6 +2,8 @@
/* vim: set ft=javascript: */
/*jshint newcap: false */
(function(root, factory) {
/*jshint ignore:start */
/*eslint-disable */
"use strict";
if(typeof cptable === "undefined") {
if(typeof require !== "undefined"){
@ -10,8 +12,11 @@
else root.cptable = factory(cpt);
} else throw new Error("cptable not found");
} else cptable = factory(cptable);
/*eslint-enable */
/*jshint ignore:end */
}(this, function(cpt){
"use strict";
/*global module, Buffer */
var magic = {
"1200":"utf16le",
"1201":"utf16be",
@ -265,7 +270,7 @@
}
}
};
var null_enc = function(data, ofmt) { return ""; };
var null_enc = function(data, ofmt) { void ofmt; return ""; };
var cp_decache = function cp_decache(cp) { delete cpdcache[cp]; delete cpecache[cp]; };
var decache = function decache() {
if(has_buf) {
@ -479,6 +484,7 @@
if(data[i] !== 0x2b) { j=1; out[k++] = String.fromCharCode(data[i]); continue; }
j=1;
if(data[i+1] === 0x2d) { j = 2; out[k++] = "+"; continue; }
// eslint-disable-next-line no-useless-escape
while(String.fromCharCode(data[i+j]).match(/[A-Za-z0-9+\/]/)) j++;
var dash = 0;
if(data[i+j] === 0x2d) { ++j; dash=1; }

View File

@ -12,7 +12,7 @@ type CPIndex = number|string;
type CPTable = {
[key: CPIndex]:CPEntry;
utils:{
decode:any;
decode(cp:CPIndex, data:OutType): string;
encode(cp:CPIndex, data:StrData, ofmt:?string):OutType;
hascp(cp:number):boolean;
magic:any;

View File

@ -1,12 +1,54 @@
{
"name": "codepage",
"version": "1.11.1",
"version": "1.12.0",
"author": "SheetJS",
"description": "pure-JS library to handle codepages",
"keywords": [ "codepage", "iconv", "convert", "strings" ],
"bin": {
"codepage": "./bin/codepage.njs"
},
"main": "cputils.js",
"types": "types",
"browser": {
"buffer": "false"
},
"dependencies": {
"commander": "~2.11.0",
"exit-on-epipe": "~1.0.1",
"voc": "~1.0.0"
},
"devDependencies": {
"mocha": "~2.5.3",
"blanket": "~1.2.3",
"@sheetjs/uglify-js": "~2.7.3",
"@types/node": "^8.0.7",
"@types/commander": "^2.9.0",
"dtslint": "^0.1.2",
"typescript": "2.2.0"
},
"repository": { "type":"git", "url":"git://github.com/SheetJS/js-codepage.git"},
"scripts": {
"pretest": "git submodule init && git submodule update",
"test": "make test",
"build": "make js",
"lint": "make fullint",
"dtslint": "dtslint types"
},
"config": {
"blanket": {
"pattern": "[cputils.js]"
}
},
"alex": {
"allow": [
"chinese",
"european",
"german",
"japanese",
"latin"
]
},
"homepage": "http://sheetjs.com/opensource",
"files": [
"LICENSE",
"README.md",
@ -16,26 +58,6 @@
"dist/sbcs.full.js",
"dist/cpexcel.full.js"
],
"main": "cputils.js",
"dependencies": {
"voc":"~1.0.0",
"exit-on-epipe":"~1.0.1",
"commander":"~2.11.0"
},
"devDependencies": {
"mocha":"~2.5.3"
},
"repository": { "type":"git", "url":"git://github.com/SheetJS/js-codepage.git"},
"scripts": {
"pretest": "git submodule init && git submodule update",
"test": "make test",
"build": "make js"
},
"config": {
"blanket": {
"pattern": "[cputils.js]"
}
},
"bugs": { "url": "https://github.com/SheetJS/js-codepage/issues" },
"license": "Apache-2.0",
"engines": { "node": ">=0.8" }

View File

@ -1,6 +1,6 @@
/* sbcs.js (C) 2013-present SheetJS -- http://sheetjs.com */
/*jshint -W100 */
var cptable = {version:"1.11.0"};
var cptable = {version:"1.12.0"};
cptable[37] = (function(){ var d = "\u0000\u0001\u0002\u0003œ\t†—Ž\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013…\b‡\u0018\u0019’\u001c\u001d\u001e\u001f€‚ƒ„\n\u0017\u001bˆ‰Š‹Œ\u0005\u0006\u0007‘\u0016“”•–\u0004˜™š›\u0014\u0015ž\u001a  âäàáãåçñ¢.<(+|&éêëèíîïìß!$*);¬-/ÂÄÀÁÃÅÇѦ,%_>?øÉÊËÈÍÎÏÌ`:#@'=\"Øabcdefghi«»ðýþ±°jklmnopqrªºæ¸Æ¤µ~stuvwxyz¡¿ÐÝÞ®^£¥·©§¶¼½¾[]¯¨´×{ABCDEFGHI­ôöòóõ}JKLMNOPQR¹ûüùúÿ\\÷STUVWXYZ²ÔÖÒÓÕ0123456789³ÛÜÙڟ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
cptable[437] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
cptable[500] = (function(){ var d = "\u0000\u0001\u0002\u0003œ\t†—Ž\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013…\b‡\u0018\u0019’\u001c\u001d\u001e\u001f€‚ƒ„\n\u0017\u001bˆ‰Š‹Œ\u0005\u0006\u0007‘\u0016“”•–\u0004˜™š›\u0014\u0015ž\u001a  âäàáãåçñ[.<(+!&éêëèíîïìß]$*);^-/ÂÄÀÁÃÅÇѦ,%_>?øÉÊËÈÍÎÏÌ`:#@'=\"Øabcdefghi«»ðýþ±°jklmnopqrªºæ¸Æ¤µ~stuvwxyz¡¿ÐÝÞ®¢£¥·©§¶¼½¾¬|¯¨´×{ABCDEFGHI­ôöòóõ}JKLMNOPQR¹ûüùúÿ\\÷STUVWXYZ²ÔÖÒÓÕ0123456789³ÛÜÙڟ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
@ -107,4 +107,5 @@ cptable[29001] = (function(){ var d = "ΈΉΊΌΎ°◘○◙♂♀♪♬
cptable[38598] = (function(){ var d = "\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¢£¤¥¦§¨©×«¬­®‾°±²³´µ¶·¸¹÷»¼½¾‗אבגדהוזחטיךכלםמןנסעףפץצקרשת", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
cptable[620] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÇüéâäàąçêëèïîćÄĄĘęłôöĆûùŚÖÜ¢Ł¥śƒŹŻóÓńŃźż¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
cptable[895] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ČüéďäĎŤčěĚĹÍľǪÄÁÉžŽôöÓůÚýÖÜŠĽÝŘťáíóúňŇŮÔšřŕŔ¼§«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
// eslint-disable-next-line no-undef
if (typeof module !== 'undefined' && module.exports && typeof DO_NOT_EXPORT_CODEPAGE === 'undefined') module.exports = cptable;

106
types/bin_codepage.ts Executable file
View File

@ -0,0 +1,106 @@
/* js-codepage (C) 2014-present SheetJS -- http://sheetjs.com */
/* eslint-env node */
/* vim: set ts=2 ft=javascript: */
/*jshint node:true */
/// <reference types="../node_modules/@types/node/" />
/* node type definition is missing writable stream _writev */
interface Chunk { chunk: any; encoding: string; }
type CBType = () => void;
import codepage from 'codepage';
import 'exit-on-epipe';
import fs = require('fs');
import stream = require('stream');
const program/*:any*/ = (require('commander')/*:any*/);
program
.version(codepage.version)
.usage('[options] <file>')
.option('-f, --from-code <code>', 'codepage of input (default 65001 utf8)')
.option('-t, --to-code <code>', 'codepage of output (default 65001 utf8)')
.option('-o, --output <file>', 'output file (<file>.<to> if specified)')
.option('-B, --bom', 'write BOM (for unicode codepages)')
.option('-F, --force', 'force writing to stdout for non-utf8 codepages')
.option('-l, --list', 'List supported codepages');
program.on('--help', function() {
console.log(' Codepage descriptions can be found in the README');
console.log(' http://oss.sheetjs.com/js-codepage/README.md');
console.log(' Support email: dev.codepage@sheetjs.com');
});
program.parse(process.argv);
if(program.list) {
const l: number[] = [];
Object.keys(codepage).forEach(function(x) { if(parseInt(x, 10) === +x) l.push(+x); });
Object.keys(codepage.utils.magic).forEach(function(x) { if(parseInt(x, 10) === +x && +x !== 16969) l.push(+x); });
l.sort(function(a,b) { return a-b; }).forEach(function(x) { console.log(x); });
process.exit();
}
const fr: number = +program.fromCode || 65001;
const to: number = +program.toCode || 65001;
let f: string = program.args[0];
const o: string = program.output;
if(!process.stdin.isTTY) f = f || "-";
if(f !== "-" && !fs.existsSync(f)) {
console.error('codepage: must specify a filename');
process.exit(13);
}
function concat(func: (b: Buffer)=>void) {
// $FlowIgnore
const writable = new stream.Writable();
const buf: Buffer[] = [];
writable._write = function(chunk: any, e: string, cb: CBType) { buf.push(chunk); cb(); };
(<any>writable)._writev = function(chunks: Chunk[], cb: CBType) { chunks.forEach(function(c) { buf.push(c.chunk); cb(); }); };
writable.on('finish', function() { func(Buffer.concat(buf)); });
return writable;
}
if(f === "-") process.stdin.pipe(concat(process_text));
else process_text(fs.readFileSync(f));
function process_text(text: Buffer) {
const dec: Buffer = <any>(codepage.utils.decode(fr, text));
const bom: Buffer[] = [];
bom[1200] = new Buffer([0xFF, 0xFE]);
bom[1201] = new Buffer([0xFE, 0xFF]);
bom[12000] = new Buffer([0xFF, 0xFE, 0x00, 0x00]);
bom[12001] = new Buffer([0x00, 0x00, 0xFE, 0xFF]);
bom[16969] = new Buffer([0x69, 0x69]);
bom[65000] = new Buffer([0x2B, 0x2F, 0x76, 0x2B]);
bom[65001] = new Buffer([0xEF, 0xBB, 0xBF]);
const mybom = (program.bom && bom[to] ? bom[to] : "");
const out: any = to === 65001 ? dec.toString('utf8') : codepage.utils.encode(to, dec);
/* if output file is specified */
if(o) writefile(o, out, mybom);
/* utf8 -> print to stdout */
else if(to === 65001) logit(out, mybom);
/* stdout piped to process -> print */
else if(!process.stdout.isTTY) logit(out, mybom);
/* forced */
else if(program.force) logit(out, mybom);
/* input file specified -> write to file */
else if(f !== "-") writefile(f + "." + to, out, mybom);
else {
console.error('codepage: use force (-F, --force) to print ' + to + ' codes');
process.exit(14);
}
}
function logit(out: Buffer, bom: string|Buffer) {
process.stdout.write(bom);
process.stdout.write(out);
}
function writefile(o: string, out: Buffer, bom: string|Buffer) {
fs.writeFileSync(o, bom);
fs.appendFileSync(o, out);
}

13
types/codepage-test.ts Normal file
View File

@ -0,0 +1,13 @@
import cptable from 'codepage';
const unicode_cp10000_255: string = cptable[10000].dec[255]; // ˇ
const cp10000_711: number = cptable[10000].enc[String.fromCharCode(711)]; // 255
const 汇总: string = cptable.utils.decode(936, [0xbb,0xe3,0xd7,0xdc]);
const buf: Uint8Array = <Uint8Array>(cptable.utils.encode(936, ));
const sushi: string = cptable.utils.decode(65001, [0xf0,0x9f,0x8d,0xa3]); // 🍣
const sbuf: Uint8Array = <Uint8Array>(cptable.utils.encode(65001, sushi));
cptable.utils.hascp(10000);

39
types/index.d.ts vendored Normal file
View File

@ -0,0 +1,39 @@
/* codepage.js (C) 2013-present SheetJS -- http://sheetjs.com */
// TypeScript Version: 2.2
/** Codepage index type (integer or string representation) */
export type CP$Index = number | string;
/* Individual codepage converter */
export interface CP$Conv {
enc: {[n: string]: number; };
dec: {[n: number]: string; };
}
/** Encode input type (string, array of characters, Buffer) */
export type CP$String = string | string[] | Uint8Array;
/** Encode output / decode input type */
export type CP$Data = string | number[] | Uint8Array;
/** General utilities */
export interface CP$Utils {
decode(cp: CP$Index, data: CP$Data): string;
encode(cp: CP$Index, data: CP$String, opts?: any): CP$Data;
hascp(n: number): boolean;
magic: {[cp: string]: string};
}
/* note: TS cannot export top-level indexer, hence default workaround */
export interface CP$Module {
/** Version string */
version: string;
/** Utility Functions */
utils: CP$Utils;
/** Codepage Converters */
[cp: number]: CP$Conv;
}
export const cptable: CP$Module;
export default cptable;

14
types/tsconfig.json Normal file
View File

@ -0,0 +1,14 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [ "es5" ],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": false,
"baseUrl": ".",
"paths": { "codepage": ["."] },
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
}
}

11
types/tslint.json Normal file
View File

@ -0,0 +1,11 @@
{
"extends": "dtslint/dtslint.json",
"rules": {
"whitespace": false,
"no-sparse-arrays": false,
"only-arrow-functions": false,
"no-consecutive-blank-lines": false,
"prefer-conditional-expression": false,
"one-variable-per-declaration": false
}
}