public static function html2text($html)
    {
        libxml_use_internal_errors(true);
        $doc = new \DOMDocument();

        // Hack to force UTF-8 processing on incomplete documents
        // From: http://php.net/manual/en/domdocument.loadhtml.php#95251
        $doc->loadHTML('<?xml encoding="UTF-8">' . $html, LIBXML_NOERROR | LIBXML_NOWARNING);
        foreach ($doc->childNodes as $item) {
            if ($item->nodeType == XML_PI_NODE) {
                $doc->removeChild($item);  // Remove the hack we inserted above
                break;  // We know there is only one
            };
        };
        $doc->encoding = 'UTF-8';  // Proper way to set encoding

        return self::_dom2text($doc);
    }