parameters: (self)
return_statement: return encoding
docstring: Report the encoding declared by the meta element
docstring_summary: Report the encoding declared by the meta element
docstring_tokens: Report the encoding declared by the meta element
function: 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
function_tokens: 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