Current section
Files
Jump to
Current section
Files
iconvex_unicode
README.md
README.md
# Iconvex Unicode
`iconvex_unicode` adds 17 pure-Elixir byte-stream codecs and two logical
non-octet Unicode formats to [Iconvex](https://hex.pm/packages/iconvex).
The OTP application publishes the complete name set in one transaction.
The package includes:
- BOCU-1, CESU-8, SCSU, UTF-1, UTF-EBCDIC, and WTF-8.
- Historical 31-bit FSS-UTF (`UTF-2`).
- Draft UTF-5 and whole-hostname UTF-6.
- Strict Formal SignWriting in ASCII (`FSW`).
- Explicit Iconvex UTF-16 and UTF-32 signature profiles.
- RFC 4042 UTF-9 and UTF-18, both as packed bitstrings and explicit
endian-safe byte transports.
```elixir
{:ok, compressed} = Iconvex.convert("日本語", "UTF-8", "BOCU-1")
{:ok, "日本語"} = Iconvex.convert(compressed, "BOCU-1", "UTF-8")
{:ok, packed_nonets} = Iconvex.Unicode.UTF9.encode_packed([?A, 0x0391, 0x10330])
{:ok, [?A, 0x0391, 0x10330]} = Iconvex.Unicode.UTF9.decode_packed(packed_nonets)
{:ok, fsw} = Iconvex.Unicode.FormalSignWriting.encode([0x40001])
{:ok, "S10000"} = {:ok, fsw}
```
Bare `UTF-9` and `UTF-18` are not byte-registry names.
Use `UTF-9-16BE`, `UTF-9-16LE`, `UTF-18-24BE`, or `UTF-18-24LE` with `Iconvex.convert/4`.
Call the logical modules for native packed bitstrings.
## Development
Use the local Core checkout in this monorepo:
```console
ICONVEX_PATH=../iconvex mix test
```
The runtime implementation uses LGPL-2.1-or-later.
`NOTICE` describes retained source records and Internet-Draft notices.
<!-- iconvex-codec-catalog:start -->
## Complete codec catalog
The generator builds this table from the release inventories.
Do not edit this section by hand.
Codec names ignore ASCII letter case.
You can use each alias to look up its codec.
Aliases do not increase the canonical codec count.
**17 canonical codecs · 33 aliases · 50 accepted names.**
### Registered codec names
| Canonical codec | Accepted aliases | Stateful |
|---|---|:---:|
| `BOCU-1` | `BOCU1`<br>`csBOCU-1` | Yes |
| `CESU-8` | `CESU8`<br>`csCESU-8` | No |
| `FSS-UTF` | `UTF-2` | No |
| `FSW` | `FORMAL-SIGNWRITING-ASCII`<br>`FORMAL-SIGNWRITING-IN-ASCII`<br>`FSW-2012`<br>`FSW-ASCII` | No |
| `ICONVEX-UTF-16-SIGNATURE-LE-DEFAULT` | `ICONVEX_UTF_16_SIGNATURE_LE_DEFAULT` | Yes |
| `ICONVEX-UTF-32BE-SIGNATURE` | `ICONVEX_UTF_32BE_SIGNATURE` | Yes |
| `ICONVEX-UTF-32LE-SIGNATURE` | `ICONVEX_UTF_32LE_SIGNATURE` | Yes |
| `SCSU` | `csSCSU` | Yes |
| `UTF-1` | `csISO10646UTF1`<br>`ISO-10646-UTF-1`<br>`ISO-IR-178`<br>`UTF1` | No |
| `UTF-18-24BE` | `UTF-18-24-BE`<br>`UTF18-24BE` | No |
| `UTF-18-24LE` | `UTF-18-24-LE`<br>`UTF18-24LE` | No |
| `UTF-5` | `DRAFT-JSENG-UTF5-01`<br>`UTF5` | No |
| `UTF-6` | `DRAFT-IETF-IDN-UTF6-00`<br>`UTF6` | No |
| `UTF-9-16BE` | `UTF-9-16-BE`<br>`UTF9-16BE` | No |
| `UTF-9-16LE` | `UTF-9-16-LE`<br>`UTF9-16LE` | No |
| `UTF-EBCDIC` | `UTFEBCDIC`<br>`UTF_EBCDIC` | No |
| `WTF-8` | `WOBBLY-TRANSFORMATION-FORMAT-8`<br>`WTF8` | No |
### Logical non-octet codecs
**2 logical codecs · 0 aliases · 4 byte transports.**
These codecs keep their specified unit width.
The byte transports provide explicit registry-compatible forms.
They do not add logical codecs.
| Logical codec | Accepted aliases | Unit bits | Byte transports |
|---|---|---:|---|
| `UTF-18` | — | 18 | `UTF-18-24BE`<br>`UTF-18-24LE` |
| `UTF-9` | — | 9 | `UTF-9-16BE`<br>`UTF-9-16LE` |
<!-- iconvex-codec-catalog:end -->