Skip to content

Commit 5aacbbf

Browse files
committed
version bump 1.5.0
new codepages: - 808 OEM Russian; Cyrillic + Euro symbol - 872 OEM Cyrillic (primarily Russian) + Euro Symbol - 1010 IBM EBCDIC French - 1132 IBM EBCDIC Lao (1132 / 1133 / 1341) - 47451 Atari ST/TT other changes: - updated travis versions for test - miscellaneous adjustments to tooling
1 parent 9e7fe63 commit 5aacbbf

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+2752
-1021
lines changed

.flowconfig

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
[ignore]
2+
.*/node_modules/.*
3+
.*/dist/.*
4+
.*/test.js
5+
6+
.*/bits/.*
7+
.*/ctest/.*
8+
.*/misc/.*
9+
.*/codepages/.*
10+
11+
.*/shim.js
12+
.*/prof.js
13+
.*/cputils.js
14+
.*/cptable.js
15+
.*/sbcs.js
16+
.*/dbcs.js
17+
18+
[include]
19+
cputils.flow.js
20+
21+
[libs]
22+
misc/flow.js
23+
24+
[options]

.travis.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
language: node_js
22
node_js:
3-
- "5.0"
3+
- "6"
4+
- "5"
45
- "4.2"
56
- "0.12"
67
- "0.10"

Makefile

+62-37
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,87 @@
11
SHELL=/bin/bash
22
VOC=voc
3-
TARGETS=cptable.js cputils.js cpexcel.js sbcs.js
3+
TARGET=cptable.js
4+
AUXTARGETS=cputils.js cpexcel.js sbcs.js
45

5-
.PHONY: js voc
6+
## Main Targets
7+
8+
.PHONY: all
9+
all: voc ## Build library and auxiliary scripts
10+
11+
.PHONY: voc
612
voc test.js: codepage.md
713
$(VOC) codepage.md
814

9-
js: make.sh codepage.md
15+
.PHONY: js
16+
js: make.sh codepage.md ## Build all output targets
1017
bash make.sh <(awk -F, '$$3=="1"' pages.csv) sbcs.js cptable
1118
bash make.sh excel.csv cpexcel.js cptable
1219
bash make.sh
20+
make cputils.js
1321

14-
.PHONY: init
15-
init:
16-
bash misc/init.sh
22+
cputils.js: %.js : %.flow.js
23+
node -e 'process.stdout.write(require("fs").readFileSync("$<","utf8").replace(/^[ \t]*\/\*[:#][^*]*\*\/[ \t]*(\n)?/gm,"").replace(/\/\*[:#][^*]*\*\//gm,""))' > $@
1724

1825
.PHONY: clean
19-
clean:
26+
clean: ## Remove targets and build artifaats
2027
rm -f make.sh .vocrc pages.csv bits/*.js
2128

22-
.PHONY: test mocha
23-
test mocha: test.js
24-
mocha -R spec
29+
.PHONY: dist ## Copy files for distribution
30+
dist: $(TARGET) $(AUXTARGETS)
31+
cp $(TARGET) $(AUXTARGETS) LICENSE dist/
2532

26-
.PHONY: prof
27-
prof:
28-
cat misc/prof.js test.js > prof.js
29-
node --prof prof.js
33+
## Testing
3034

31-
.PHONY: lint
32-
lint:
33-
jshint --show-non-errors $(TARGETS)
34-
jscs $(TARGETS)
35+
.PHONY: test mocha
36+
test mocha: test.js $(TARGET) baseline ## Run test suite
37+
mocha -R spec -t 20000
3538

3639
.PHONY: ctest
37-
ctest:
40+
ctest: ## Build browser test (into ctest/ subdirectory)
3841
bash ctest/fixtures.sh
3942

40-
.PHONY: cov cov-spin
41-
cov: misc/coverage.html
42-
cov-spin:
43-
make cov & bash misc/spin.sh $$!
43+
.PHONY: ctestserv
44+
ctestserv: ## Start a test server on port 8000
45+
@python -mSimpleHTTPServer
46+
47+
.PHONY: baseline
48+
baseline: ## Build test baselines
49+
@bash ./misc/make_baseline.sh
50+
51+
## Code Checking
4452

45-
misc/coverage.html: test.js
46-
mocha --require blanket -R html-cov > $@
53+
.PHONY: lint
54+
lint: $(TARGET) $(AUXTARGETS) ## Run jshint and jscs checks
55+
@jshint --show-non-errors $(TARGET) $(AUXTARGETS)
56+
@jshint --show-non-errors package.json
57+
@jshint --show-non-errors --extract=always $(HTMLLINT)
58+
@jscs $(TARGET) $(AUXTARGETS)
59+
60+
.PHONY: flow
61+
flow: lint ## Run flow checker
62+
@flow check --all --show-all-errors
63+
64+
.PHONY: cov
65+
cov: misc/coverage.html ## Run coverage test
66+
67+
misc/coverage.html: $(TARGET) test.js
68+
mocha --require blanket -R html-cov -t 20000 > $@
69+
70+
.PHONY: coveralls
71+
coveralls: ## Coverage Test + Send to coveralls.io
72+
mocha --require blanket --reporter mocha-lcov-reporter -t 20000 | node ./node_modules/coveralls/bin/coveralls.js
73+
74+
.PHONY: prof
75+
prof:
76+
cat misc/prof.js test.js > prof.js
77+
node --prof prof.js
4778

48-
.PHONY: coveralls coveralls-spin
49-
coveralls:
50-
mocha --require blanket --reporter mocha-lcov-reporter | ./node_modules/coveralls/bin/coveralls.js
5179

52-
coveralls-spin:
53-
make coveralls & bash misc/spin.sh $$!
5480

55-
.PHONY: dist
56-
dist: dist/cpexcel.full.js dist/cptable.full.js dist/sbcs.full.js
57-
cp $(TARGETS) dist/
58-
cp LICENSE dist/
81+
.PHONY: help
82+
help:
83+
@grep -hE '(^[a-zA-Z_-][ a-zA-Z_-]*:.*?|^#[#*])' $(MAKEFILE_LIST) | bash misc/help.sh
5984

60-
.PHONY: dist/cpexcel.full.js dist/cptable.full.js dist/sbcs.full.js
61-
dist/cpexcel.full.js dist/cptable.full.js dist/sbcs.full.js : dist/%.full.js: %.js cputils.js
62-
cat $^ > $@
85+
#* To show a spinner, append "-spin" to any target e.g. cov-spin
86+
%-spin:
87+
@make $* & bash misc/spin.sh $$!

NOTES.md

+9-4
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
11
# Verifying Codepages
22

33
After installing every language pack in Windows 7, many codepages are available
4-
via the .NET System.Text.Encoding class. The MakeEncoding.cs source included with
5-
the project generates a full manifest that can be parsed into a mapping table.
4+
via the .NET System.Text.Encoding class. The included MakeEncoding.cs program
5+
generates a full manifest that can be parsed into a mapping table.
66

77
The included `nls2tbl` script extracts data from the various `C_#####.NLS` files
88
available in the system or system32 directories in various versions of Windows.
99

1010
Many codepages are also available in various iconv libraries, but there are some
11-
differences. For example, some codepages break ASCII by using the Arabic percent
12-
sign ٪ U+066A but other libraries assume they preserve the ASCII space.
11+
differences. For example, some codepages use the Arabic percent sign ٪ U+066A
12+
instead of the standard ASCII "%".
13+
14+
## Extended Characters
15+
16+
No known codepage uses characters from the SMP, so certain code paths are never
17+
tested. The coverage will not be 100%
1318

1419
# Missing Codepages
1520

0 commit comments

Comments
 (0)