Python codec for CSS.
Detect the encoding of the byte string input, which contains the beginning of a CSS file. This function returns the detected encoding (or None if it hasn’t got enough data), and a flag that indicates whether that encoding has been detected explicitely or implicitely. To detect the encoding the first few bytes are used (or if input is ASCII compatible and starts with a charset rule the encoding name from the rule). “Explicit” detection means that the bytes start with a BOM or a charset rule.
If the encoding can’t be detected yet, None is returned as the encoding. final specifies whether more data will be available in later calls or not. If final is true, detectencoding_str() will never return None as the encoding.
Detect the encoding of the unicode string input, which contains the beginning of a CSS file. The encoding is detected from the charset rule at the beginning of input. If there is no charset rule, "utf-8" will be returned.
If the encoding can’t be detected yet, None is returned. final specifies whether more data will be available in later calls or not. If final is true, detectencoding_unicode() will never return None.