chardetect

Script which takes one or more file paths and reports on their detected encodings

Example:

% chardetect somefile someotherfile
somefile: windows-1252 with confidence 0.5
someotherfile: ascii with confidence 1.0

If no paths are provided, it takes its input from stdin.

convert2.packages.chardet.chardetect.description_of(lines, name='stdin')[source]

Return a string describing the probable encoding of a file or list of strings.

Parameters:
  • lines (Iterable of bytes) – The lines to get the encoding of.
  • name (str) – Name of file or collection of lines
convert2.packages.chardet.chardetect.main(argv=None)[source]

Handles command line arguments and gets things started.

Parameters:argv (list of str) – List of arguments, as if specified on the command-line. If None, sys.argv[1:] is used instead.