From 42a382d666f88ecd3f44ffffd8e9cd5aabc36edc Mon Sep 17 00:00:00 2001 From: Mathias Bynens Date: Fri, 15 Jul 2016 16:37:19 +0200 Subject: [PATCH] Clean up some files --- Gruntfile.js | 8 -------- README.md | 28 ++++------------------------ data/index.txt | 27 +++++++++++++++------------ package.json | 5 +++-- 4 files changed, 22 insertions(+), 46 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 384334f..29577c9 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -7,9 +7,6 @@ module.exports = function(grunt) { 'stderr': true, 'failOnError': true }, - 'fetch': { - 'command': 'curl https://encoding.spec.whatwg.org/index-windows-1258.txt > data/index.txt' - }, 'transform-data': { 'command': 'npm run build' }, @@ -83,11 +80,6 @@ module.exports = function(grunt) { 'shell:test-browser' ]); - grunt.registerTask('fetch', [ - 'shell:fetch', - 'build' - ]); - grunt.registerTask('build', [ 'shell:transform-data', 'default' diff --git a/README.md b/README.md index 1916d6a..2bf1dbb 100644 --- a/README.md +++ b/README.md @@ -12,18 +12,6 @@ Via [npm](https://www.npmjs.com/): npm install windows-1258 ``` -Via [Bower](http://bower.io/): - -```bash -bower install windows-1258 -``` - -Via [Component](https://github.com/component/component): - -```bash -component install mathiasbynens/windows-1258 -``` - In a browser: ```html @@ -73,13 +61,13 @@ An array of strings, each representing a [label](https://encoding.spec.whatwg.or This function takes a plain text string (the `input` parameter) and encodes it according to windows-1258. The return value is a ‘byte string’, i.e. a string of which each item represents an octet as per windows-1258. ```js -var encodedData = windows1258.encode(text); +const encodedData = windows1258.encode(text); ``` The optional `options` object and its `mode` property can be used to set the [error mode](https://encoding.spec.whatwg.org/#error-mode). For encoding, the error mode can be `'fatal'` (the default) or `'html'`. ```js -var encodedData = windows1258.encode(text, { +const encodedData = windows1258.encode(text, { 'mode': 'html' }); // If `text` contains a symbol that cannot be represented in windows-1258, @@ -91,13 +79,13 @@ var encodedData = windows1258.encode(text, { This function takes a byte string (the `input` parameter) and decodes it according to windows-1258. ```js -var text = windows1258.decode(encodedData); +const text = windows1258.decode(encodedData); ``` The optional `options` object and its `mode` property can be used to set the [error mode](https://encoding.spec.whatwg.org/#error-mode). For decoding, the error mode can be `'replacement'` (the default) or `'fatal'`. ```js -var text = windows1258.decode(encodedData, { +const text = windows1258.decode(encodedData, { 'mode': 'fatal' }); // If `encodedData` contains an invalid byte for the windows-1258 encoding, @@ -110,14 +98,6 @@ For decoding a buffer (e.g. from `fs.readFile`) use `buffer.toString('binary')` _windows-1258_ is designed to work in at least Node.js v0.10.0, io.js v1.0.0, Narwhal 0.3.2, RingoJS 0.8-0.11, PhantomJS 1.9.0, Rhino 1.7RC4, as well as old and modern versions of Chrome, Firefox, Safari, Opera, Edge, and Internet Explorer. -## Unit tests & code coverage - -After cloning this repository, run `npm install` to install the dependencies needed for development and testing. You may want to install Istanbul _globally_ using `npm install istanbul -g`. - -Once that’s done, you can run the unit tests in Node using `npm test` or `node tests/tests.js`. To run the tests in Rhino, Ringo, Narwhal, and web browsers as well, use `grunt test`. - -To generate the code coverage report, use `grunt cover`. - ## Notes [Similar modules for other single-byte legacy encodings are available.](https://www.npmjs.com/browse/keyword/legacy-encoding) diff --git a/data/index.txt b/data/index.txt index d0179c7..84549ce 100644 --- a/data/index.txt +++ b/data/index.txt @@ -1,19 +1,22 @@ # Any copyright is dedicated to the Public Domain. -# http://creativecommons.org/publicdomain/zero/1.0/ +# https://creativecommons.org/publicdomain/zero/1.0/ # -# For details on index-windows-1258.txt see the Encoding Standard +# For details on index index-windows-1258.txt see the Encoding Standard # https://encoding.spec.whatwg.org/ +# +# Identifier: 198bacedfcf24390e219240a7b776b6cec34cff070330b08a601a69c67f7eb24 +# Date: 2016-01-20 - 0 0x20AC € (EURO SIGN) - 1 0x0081  () - 2 0x201A ‚ (SINGLE LOW-9 QUOTATION MARK) - 3 0x0192 ƒ (LATIN SMALL LETTER F WITH HOOK) - 4 0x201E „ (DOUBLE LOW-9 QUOTATION MARK) - 5 0x2026 … (HORIZONTAL ELLIPSIS) - 6 0x2020 † (DAGGER) - 7 0x2021 ‡ (DOUBLE DAGGER) - 8 0x02C6 ˆ (MODIFIER LETTER CIRCUMFLEX ACCENT) - 9 0x2030 ‰ (PER MILLE SIGN) + 0 0x20AC € (EURO SIGN) + 1 0x0081  () + 2 0x201A ‚ (SINGLE LOW-9 QUOTATION MARK) + 3 0x0192 ƒ (LATIN SMALL LETTER F WITH HOOK) + 4 0x201E „ (DOUBLE LOW-9 QUOTATION MARK) + 5 0x2026 … (HORIZONTAL ELLIPSIS) + 6 0x2020 † (DAGGER) + 7 0x2021 ‡ (DOUBLE DAGGER) + 8 0x02C6 ˆ (MODIFIER LETTER CIRCUMFLEX ACCENT) + 9 0x2030 ‰ (PER MILLE SIGN) 10 0x008A Š () 11 0x2039 ‹ (SINGLE LEFT-POINTING ANGLE QUOTATION MARK) 12 0x0152 Œ (LATIN CAPITAL LIGATURE OE) diff --git a/package.json b/package.json index 3ef752b..8cecfad 100644 --- a/package.json +++ b/package.json @@ -31,8 +31,9 @@ "windows-1258.js" ], "scripts": { - "test": "node tests/tests.js", - "build": "node scripts/transform-data.js" + "download": "curl https://encoding.spec.whatwg.org/index-windows-1258.txt > data/index.txt", + "build": "node scripts/transform-data.js", + "test": "node tests/tests.js" }, "devDependencies": { "coveralls": "^2.11.6",