package uuuu
All checked builds passInstall
dune-project
Dependency
Authors
Maintainers
Sources
sha256=e7e18d93db37e99a1cac08eebe50c88904eae9617dab433c8f787f4da92b1928
sha512=dc84dcd3156b5c1fa414c73ad78ef3c9f8b626bfbc3159f262e3d7d17325f098f28dd55d93f7643cb5b8329fa54f2ca876f442fefe399b92afe0a5430134d66f
Description
A simple mapper between ISO-8859-* to Unicode. Useful for a translation between ISO-8859-* and Unicode
Added to opam-repository:
README
Uuuu
Uhuhuhuhuhuh! uuuu (Universal Unifier to Unicode Un OCaml) is a little library to normalize an ISO-8859 input to Unicode code-point. This library uses tables provided by the Unicode Consortium:
This project takes tables and converts them to OCaml code. Then, it provides a non-blocking best-effort decoder to translate ISO-8859 codepoint to UTF-8 codepoint.
How to use it?
uuuu has an streaming interface. So it should be easy to use it and trick on it. uuuu has a simple goal, offer a general way to decode an ISO-8859 input and normalize it to unicode codepoints. We need to be able to control memory-consumption and ensure to offer a non-blocking computation. Finally, an error should not stop the process of the decoding.
This is a little example with uutf to translate a latin1 to UTF-8:
let trans ic oc =
let decoder = Uuuu.decoder (Uuuu.encoding_of_string "latin1") (`Channel ic) in
let encoder = Uutf.encoder `UTF_8 (`Channel oc) in
let rec go () = match Uuuu.decode decoder with
| `Await -> assert false (* XXX(dinosaure): impossible when you use `String of `Channel as source. *)
| `Uchar _ as uchar -> ignore @@ Uutf.encode encoder uchar ; go ()
| `End -> ignore @@ Uutf.encoder `End
| `Malformed err -> failwith err in
go ()
let () = trans stdin stdoutAbout encoding_of_string
uuuu follows aliases availables into IANA character sets database: https://www.iana.org/assignments/character-sets.xhtml
Others aliases will raise an exception. This function is case-sensitive.
A larger decoder
uuuu is a part of a biggest project rosetta which is a decoder for some others encodings. If you want to handle more encodings than ISO-8859, you should look into this higher library.
Dev Dependencies
None
Optional Dependencies
None
Used by (1)
Conflicts
None
Build status
Results of building uuuu with each compiler on check.ci.ocaml.org, run of against opam-repository 8d8d144. All results for this package.
Each result links to its build log. To keep crawlers from overloading the site, build logs require a GitHub sign-in (see ocurrent/opam-health-check). On your first log, GitHub asks you to “Authorize opam-health-check”, the OCurrent app that runs these checks; it sees only your public profile, not your repositories. The sign-in lasts 30 days.
| Version | OCaml 4.11 | OCaml 4.14 | OCaml 5.2 | OCaml 5.4 | OCaml 5.5 |
|---|---|---|---|---|---|
| 0.4.0 (this version) | good | good | good | good | good |
- good Package successfully built
- partial One of the dependencies failed to build
- bad Package failed to build
- n/a Package is not available in this environment
- internal Internal failure