Shift_JIS, EUC-JPでエンコードされたページのOGP取得対応 (#64)

refs #61
This commit is contained in:
shibafu 2019-01-22 12:46:44 +09:00 committed by GitHub
parent dc91180dd4
commit 648e171a57
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -18,7 +18,7 @@ class OGPResolver implements Resolver
public function parse(string $html): Metadata
{
$dom = new \DOMDocument();
@$dom->loadHTML(mb_convert_encoding($html, 'HTML-ENTITIES', 'UTF-8'));
@$dom->loadHTML(mb_convert_encoding($html, 'HTML-ENTITIES', 'ASCII,JIS,UTF-8,eucJP-win,SJIS-win'));
$xpath = new \DOMXPath($dom);
$metadata = new Metadata();