Skip to content

Commit

Permalink
README: Explain how to get a byte string from a buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
mathiasbynens committed Jul 15, 2016
1 parent c7da353 commit 9a25a20
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 15 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ var text = koi8r.decode(encodedData, {
// instead of replacing it with U+FFFD in the output, an error is thrown.
```

For decoding a buffer (e.g. from `fs.readFile`) use `buffer.toString('binary')` to get the byte string which `decode` takes.

## Support

_koi8-r_ 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.
Expand Down
27 changes: 12 additions & 15 deletions data/index.txt
Original file line number Diff line number Diff line change
@@ -1,22 +1,19 @@
# Any copyright is dedicated to the Public Domain.
# https://creativecommons.org/publicdomain/zero/1.0/
# http://creativecommons.org/publicdomain/zero/1.0/
#
# For details on index index-koi8-r.txt see the Encoding Standard
# For details on index-koi8-r.txt see the Encoding Standard
# https://encoding.spec.whatwg.org/
#
# Identifier: c5497cd9071cb352c0e56b219154e539badf63de40b71578f09e2e11fe7d50ae
# Date: 2016-01-20

0 0x2500 ─ (BOX DRAWINGS LIGHT HORIZONTAL)
1 0x2502 │ (BOX DRAWINGS LIGHT VERTICAL)
2 0x250C ┌ (BOX DRAWINGS LIGHT DOWN AND RIGHT)
3 0x2510 ┐ (BOX DRAWINGS LIGHT DOWN AND LEFT)
4 0x2514 └ (BOX DRAWINGS LIGHT UP AND RIGHT)
5 0x2518 ┘ (BOX DRAWINGS LIGHT UP AND LEFT)
6 0x251C ├ (BOX DRAWINGS LIGHT VERTICAL AND RIGHT)
7 0x2524 ┤ (BOX DRAWINGS LIGHT VERTICAL AND LEFT)
8 0x252C ┬ (BOX DRAWINGS LIGHT DOWN AND HORIZONTAL)
9 0x2534 ┴ (BOX DRAWINGS LIGHT UP AND HORIZONTAL)
0 0x2500 ─ (BOX DRAWINGS LIGHT HORIZONTAL)
1 0x2502 │ (BOX DRAWINGS LIGHT VERTICAL)
2 0x250C ┌ (BOX DRAWINGS LIGHT DOWN AND RIGHT)
3 0x2510 ┐ (BOX DRAWINGS LIGHT DOWN AND LEFT)
4 0x2514 └ (BOX DRAWINGS LIGHT UP AND RIGHT)
5 0x2518 ┘ (BOX DRAWINGS LIGHT UP AND LEFT)
6 0x251C ├ (BOX DRAWINGS LIGHT VERTICAL AND RIGHT)
7 0x2524 ┤ (BOX DRAWINGS LIGHT VERTICAL AND LEFT)
8 0x252C ┬ (BOX DRAWINGS LIGHT DOWN AND HORIZONTAL)
9 0x2534 ┴ (BOX DRAWINGS LIGHT UP AND HORIZONTAL)
10 0x253C ┼ (BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL)
11 0x2580 ▀ (UPPER HALF BLOCK)
12 0x2584 ▄ (LOWER HALF BLOCK)
Expand Down

0 comments on commit 9a25a20

Please sign in to comment.