A heuristic that detects likely mojibake. It signals which segments of text need to be fixed, and when fixing can stop.
Port of ftfy.badness. The big BADNESS_RE pattern itself is generated from
the reference implementation (see the badness_pattern/0 function in the
generated Ftfy.Data module).
Summary
Functions
@spec badness(binary()) :: non_neg_integer()
Count the unlikely character sequences in text. A value greater than 0
indicates some of it seems to be mojibake.
Whether text looks like it contains mojibake. Faster than badness/1
because it stops at the first match.