Essence\Dom\Document\Native::_fixCharset PHP Method

_fixCharset() protected method

Older versions of Libxml only recognizes: and not the new HTML5 form: with the result that parsed strings can have funny characters.
See also: http://www.glenscott.co.uk/blog/html5-character-encodings-and-domdocument-loadhtml-and-loadhtmlfile
See also: https://github.com/glenscott/dom-document-charset/blob/master/DOMDocumentCharset.php
protected _fixCharset ( )
    protected function _fixCharset()
    {
        if (LIBXML_VERSION < 20800 && stripos($this->_html, 'meta charset') !== false) {
            $this->_html = preg_replace('~<meta charset=["\']?([^"\']+)"~i', '<meta http-equiv="Content-Type" content="text/html; charset=$1"', $this->_html);
        }
    }