'Initialises the HTMLInputStream.
HTMLInputStream(source, [encoding]) -> Normalized stream from source
for use by html5lib.
source can be either a file-object, local filename or a string.
The optional encoding parameter must be a string that indicates
the encoding.  If specified, that encoding will be used,
regardless of any BOM or later declaration (such as in a meta
element)'

def __init__(self, source, override_encoding=None, transport_encoding=None, same_origin_parent_encoding=None, likely_encoding=None, default_encoding=u'windows-1252', useChardet=True):

    self.rawStream = self.openStream(source)
    HTMLUnicodeInputStream.__init__(self, self.rawStream)
    self.numBytesMeta = 1024
    self.numBytesChardet = 100
    self.override_encoding = override_encoding
    self.transport_encoding = transport_encoding
    self.same_origin_parent_encoding = same_origin_parent_encoding
    self.likely_encoding = likely_encoding
    self.default_encoding = default_encoding
    self.charEncoding = self.determineEncoding(useChardet)
    assert (self.charEncoding[0] is not None)
    self.reset()
