API Reference ftfy v#0.1.0

Copy Markdown View Source

Modules

ftfy: fixes text for you.

A heuristic that detects likely mojibake. It signals which segments of text need to be fixed, and when fixing can stop.

A command-line utility for fixing text found in a file. Port of ftfy.cli.

Details about characters and the encodings that use them: the regexes that detect mojibake-ish byte and character sequences, the "could this string have come from this single-byte encoding?" check, and the translation tables for ligatures, character width, and control-character removal.

Encoding and decoding between Elixir strings (UTF-8 binaries) and raw byte sequences, for the encodings ftfy needs.

A decoder for the "utf-8-variants" family of not-quite-UTF-8 encodings, including CESU-8 (UTF-8 layered over UTF-16 surrogate pairs) and Java's "modified UTF-8", which encodes the null character as the two bytes 0xc0 0x80.

The individual fixes that Ftfy.fix_text/2 can perform, and the functions named in "explanations" such as the output of Ftfy.fix_and_explain/2.

Functions for justifying Unicode text in a monospaced display such as a terminal, based on the display width of characters.

Configuration options for ftfy. Mirrors ftfy.TextFixerConfig.