On line ~9450, it compares $input === 'Windows-1252' && $output == 'UTF-8'. However, the relevant windows format is always returned as 'windows-1252' in lower case, so this comparison fails when it should succeed, and in fact the document fails to be parsed in my case because it can't find an encoding. The comparison should be changed to:
$input === 'windows-1252' &&...
This made it work fine in my case.
Perhaps strtolower($input) === 'windows-1252' would be better, unless $input has already been strtolower()'d
Use lowercase "windows-1252". Closed by e0b8bc6