<?php
header("Content-Type: text/html; charset=utf-8");
$html = <<<L
<!Doctype html>
<html>
<head>
<meta name="description" content="Описание сайта">
</head>
<body id="5">
Hello, Вася!
</body>
</html>
L;
$ob = new DOMDocument();
$ob->formatOutput = true;
$ob->loadHTML($html);
$str = $ob->saveHTML();
echo nl2br(htmlspecialchars($str));
?>
После выполнения этого скрипта все русские символы превращаются не пойми в че, типа этого:
Опи
В чем может быть причина? Сам файл в utf-8