Packages

Pure Elixir Unicode encoding extensions for Iconvex

Current section

Files

Jump to
Raw

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).
Starting the OTP application publishes the complete name set atomically.
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/UTF-32 signature profiles; and
- 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 deliberately not byte-registry names. Use
`UTF-9-16BE`, `UTF-9-16LE`, `UTF-18-24BE`, or `UTF-18-24LE` with
`Iconvex.convert/4`, or 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 is LGPL-2.1-or-later. Retained source records and
Internet-Draft notices are described in `NOTICE`.