(self)
return encoding
Report the encoding declared by the meta element
Report the encoding declared by the meta element
Report the encoding declared by the meta element
def detectEncodingMeta(self):
        """Report the encoding declared by the meta element
        """
        buffer = self.rawStream.read(self.numBytesMeta)
        assert isinstance(buffer, bytes)
        parser = EncodingParser(buffer)
        self.rawStream.seek(0)
        encoding = parser.getEncoding()

        if encoding is not None and encoding.name in ("utf-16be", "utf-16le"):
            encoding = lookupEncoding("utf-8")

        return encoding
def detectEncodingMeta ( self ) : buffer = self . rawStream . read ( self . numBytesMeta ) assert isinstance ( buffer , bytes ) parser = EncodingParser ( buffer ) self . rawStream . seek ( 0 ) encoding = parser . getEncoding ( ) if encoding is not None and encoding . name in ( "utf-16be" , "utf-16le" ) : encoding = lookupEncoding ( "utf-8" ) return encoding