detect_encoding method

detect_encoding

Attempts to detect text FileType.TXT, FileType.TSV, and FileType.CSV files encoding by path.

Returns

Encoding or null when fails to detect a file encoding.

def detect_encoding(self, file_path):
    ...
Parameter Type Description
file_path System.String The file name or file path.

Example

The example demonstrates how to detect text file encoding.

detect_encoding

Attempts to detect text FileType.TXT, FileType.TSV, and FileType.CSV file encoding by stream.

Returns

Encoding or null when fails to detect a file encoding.

def detect_encoding(self, stream):
    ...
Parameter Type Description
stream io.RawIOBase The file stream.

Example

The example demonstrates how to detect text file encoding.

See Also