Skip to content

Commit

Permalink
Clean up some files
Browse files Browse the repository at this point in the history
  • Loading branch information
mathiasbynens committed Jul 15, 2016
1 parent 2231a01 commit cb7fbbb
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 46 deletions.
8 changes: 0 additions & 8 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ module.exports = function(grunt) {
'stderr': true,
'failOnError': true
},
'fetch': {
'command': 'curl https://encoding.spec.whatwg.org/index-iso-8859-14.txt > data/index.txt'
},
'transform-data': {
'command': 'npm run build'
},
Expand Down Expand Up @@ -83,11 +80,6 @@ module.exports = function(grunt) {
'shell:test-browser'
]);

grunt.registerTask('fetch', [
'shell:fetch',
'build'
]);

grunt.registerTask('build', [
'shell:transform-data',
'default'
Expand Down
28 changes: 4 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,6 @@ Via [npm](https://www.npmjs.com/):
npm install iso-8859-14
```

Via [Bower](http://bower.io/):

```bash
bower install iso-8859-14
```

Via [Component](https://github.com/component/component):

```bash
component install mathiasbynens/iso-8859-14
```

In a browser:

```html
Expand Down Expand Up @@ -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 iso-8859-14. The return value is a ‘byte string’, i.e. a string of which each item represents an octet as per iso-8859-14.

```js
var encodedData = iso885914.encode(text);
const encodedData = iso885914.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 = iso885914.encode(text, {
const encodedData = iso885914.encode(text, {
'mode': 'html'
});
// If `text` contains a symbol that cannot be represented in iso-8859-14,
Expand All @@ -91,13 +79,13 @@ var encodedData = iso885914.encode(text, {
This function takes a byte string (the `input` parameter) and decodes it according to iso-8859-14.

```js
var text = iso885914.decode(encodedData);
const text = iso885914.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 = iso885914.decode(encodedData, {
const text = iso885914.decode(encodedData, {
'mode': 'fatal'
});
// If `encodedData` contains an invalid byte for the iso-8859-14 encoding,
Expand All @@ -110,14 +98,6 @@ For decoding a buffer (e.g. from `fs.readFile`) use `buffer.toString('binary')`

_iso-8859-14_ 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)
Expand Down
27 changes: 15 additions & 12 deletions data/index.txt
Original file line number Diff line number Diff line change
@@ -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-iso-8859-14.txt see the Encoding Standard
# For details on index index-iso-8859-14.txt see the Encoding Standard
# https://encoding.spec.whatwg.org/
#
# Identifier: 2c8651cfc08b1f35b17919ee5379f2fa006af3ec809f11b3b7f470785580542b
# Date: 2016-01-20

0 0x0080 € (<control>)
1 0x0081  (<control>)
2 0x0082 ‚ (<control>)
3 0x0083 ƒ (<control>)
4 0x0084 „ (<control>)
5 0x0085 … (<control>)
6 0x0086 † (<control>)
7 0x0087 ‡ (<control>)
8 0x0088 ˆ (<control>)
9 0x0089 ‰ (<control>)
0 0x0080 € (<control>)
1 0x0081  (<control>)
2 0x0082 ‚ (<control>)
3 0x0083 ƒ (<control>)
4 0x0084 „ (<control>)
5 0x0085 … (<control>)
6 0x0086 † (<control>)
7 0x0087 ‡ (<control>)
8 0x0088 ˆ (<control>)
9 0x0089 ‰ (<control>)
10 0x008A Š (<control>)
11 0x008B ‹ (<control>)
12 0x008C Œ (<control>)
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@
"iso-8859-14.js"
],
"scripts": {
"test": "node tests/tests.js",
"build": "node scripts/transform-data.js"
"download": "curl https://encoding.spec.whatwg.org/index-iso-8859-14.txt > data/index.txt",
"build": "node scripts/transform-data.js",
"test": "node tests/tests.js"
},
"devDependencies": {
"coveralls": "^2.11.6",
Expand Down

0 comments on commit cb7fbbb

Please sign in to comment.