Da li u tom HTML-u kojeg fetch-uješ sigurno postoji head sekcija i onaj tag za definisanje charset-a u njoj?
Ako uopšte nema head sekcije, dodaj je:
Code:
$content = str_ireplace('<html>', '<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8" /></head>', $content );
A ako je ima, onda samo dodaj taj meta-tag:
Code:
$content = str_ireplace('</head>', '<meta http-equiv="content-type" content="text/html; charset=utf-8" /></head>', $content );
To naravno uradi pre nego što kreiraš DOMDocument instancu. Dakle prvo fetch-uj sadržaj te stranice, pa ga onda import-uj sa
loadHTML().