Обновлены настройки Client, дозапись в базу
This commit is contained in:
@ -27,15 +27,18 @@ class ContingentParser
|
||||
{
|
||||
libxml_use_internal_errors(true);
|
||||
$dom = new \DOMDocument(
|
||||
encoding: "UTF-8"
|
||||
// encoding: "UTF-8"
|
||||
);
|
||||
$html = mb_convert_encoding(
|
||||
$html,
|
||||
'UTF-8',
|
||||
mb_detect_encoding($html, 'UTF-8, windows-1251')
|
||||
);
|
||||
$html = str_replace('windows-1251','utf-8', $html);
|
||||
$dom->loadHTML($html);
|
||||
if (mb_detect_encoding($html, 'UTF-8, windows-1251') != "UTF-8") {
|
||||
$html = mb_convert_encoding(
|
||||
$html,
|
||||
'UTF-8',
|
||||
mb_detect_encoding($html, 'UTF-8, windows-1251')
|
||||
);
|
||||
$html = str_replace('windows-1251','utf-8', $html);
|
||||
} else {
|
||||
$dom->loadHTML(mb_convert_encoding($html,'HTML-ENTITIES','UTF-8'));
|
||||
}
|
||||
$this->xpath = new \DOMXPath($dom);
|
||||
$this->template = $template;
|
||||
}
|
||||
|
Reference in New Issue
Block a user