Skip to main content

label_encoding

Function label_encoding 

Source
pub fn label_encoding(label: &str) -> Option<&'static Encoding>
Expand description

The encoding a charset label names, as Localization OS reads a declaration (codecs.lookup, then its _LABEL_ALIASES): the WHATWG label first (what encoding_rs knows), then Python’s codec names and aliases of the legacy charsets a file may declare (CP932, cp936, sjis, ujis, uhc, ms949, iso8859_2 …), normalised the way Python does (case, and runs of punctuation as one _). Python’s ISO-8859-1, Windows-1252 and UTF-16 aliases are not in the table: LocOS reads those by its default path, not as a declaration.