Skip to content

Commit 6c8157b

Browse files
CopilotChALkeR
andcommitted
Match single-byte.d.ts header to README.md documentation
Co-authored-by: ChALkeR <291301+ChALkeR@users.noreply.github.com>
1 parent 33e2f20 commit 6c8157b

1 file changed

Lines changed: 23 additions & 4 deletions

File tree

single-byte.d.ts

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,32 @@
11
/**
2-
* Single-byte encoding/decoding
3-
*
42
* ```js
53
* import { createSinglebyteDecoder, createSinglebyteEncoder } from '@exodus/bytes/single-byte.js'
6-
* import { latin1toString, latin1fromString } from '@exodus/bytes/single-byte.js'
74
* import { windows1252toString, windows1252fromString } from '@exodus/bytes/single-byte.js'
5+
* import { latin1toString, latin1fromString } from '@exodus/bytes/single-byte.js'
86
* ```
97
*
10-
* Supports various single-byte character encodings like ISO-8859-* and Windows-125*.
8+
* Decode / encode the legacy single-byte encodings according to the
9+
* [Encoding standard](https://encoding.spec.whatwg.org/)
10+
* ([§9](https://encoding.spec.whatwg.org/#legacy-single-byte-encodings),
11+
* [§14.5](https://encoding.spec.whatwg.org/#x-user-defined)),
12+
* and [unicode.org](https://unicode.org/Public/MAPPINGS/ISO8859) `iso-8859-*` mappings.
13+
*
14+
* Supports all single-byte encodings listed in the WHATWG Encoding standard:
15+
* `ibm866`, `iso-8859-2`, `iso-8859-3`, `iso-8859-4`, `iso-8859-5`, `iso-8859-6`, `iso-8859-7`, `iso-8859-8`,
16+
* `iso-8859-8-i`, `iso-8859-10`, `iso-8859-13`, `iso-8859-14`, `iso-8859-15`, `iso-8859-16`, `koi8-r`, `koi8-u`,
17+
* `macintosh`, `windows-874`, `windows-1250`, `windows-1251`, `windows-1252`, `windows-1253`, `windows-1254`,
18+
* `windows-1255`, `windows-1256`, `windows-1257`, `windows-1258`, `x-mac-cyrillic` and `x-user-defined`.
19+
*
20+
* Also supports `iso-8859-1`, `iso-8859-9`, `iso-8859-11` as defined at
21+
* [unicode.org](https://unicode.org/Public/MAPPINGS/ISO8859)
22+
* (and all other `iso-8859-*` encodings there as they match WHATWG).
23+
*
24+
* > [!NOTE]
25+
* > While all `iso-8859-*` encodings supported by the [WHATWG Encoding standard](https://encoding.spec.whatwg.org/) match
26+
* > [unicode.org](https://unicode.org/Public/MAPPINGS/ISO8859), the WHATWG Encoding spec doesn't support
27+
* > `iso-8859-1`, `iso-8859-9`, `iso-8859-11`, and instead maps them as labels to `windows-1252`, `windows-1254`, `windows-874`.\
28+
* > `createSinglebyteDecoder()` (unlike `TextDecoder` or `legacyHookDecode()`) does not do such mapping,
29+
* > so its results will differ from `TextDecoder` for those encoding names.
1130
*
1231
* @module @exodus/bytes/single-byte.js
1332
*/

0 commit comments

Comments
 (0)