#142 Charset CP1252 not detected

v1.0_(example)
open
nobody
None
5
2014-08-16
2014-08-16
Daniel Minder
No

In line 1254, the encoding_list parameter of mb_detect_encoding is defined as array( "UTF-8", "CP1252" ). However, according to http://de2.php.net/manual/de/function.mb-detect-order.php CP1252 is not included in the detectors, and on my system it is also not included in the output of mb_list_encodings(). Therefore, the mb_detect_encoding() call returns an empty string on an CP1252 document.

To make simple_html_doc work correctly, line 1254 has to be changed to
mb_detect_encoding($this->root->plaintext . "ascii", array( "UTF-8", "ISO-8859-1" ) );
(Note that the "$encoding_list = " is not needed as it defines a local variable in the caller's context)

Discussion