'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)
parseMeta - Look for a <meta> element containing encoding information'

def __init__(self, source):

    if (not utils.supports_lone_surrogates):
        self.reportCharacterErrors = None
        self.replaceCharactersRegexp = None
    elif (len(u'\U0010ffff') == 1):
        self.reportCharacterErrors = self.characterErrorsUCS4
        self.replaceCharactersRegexp = re.compile(eval(u'"[\\uD800-\\uDFFF]"'))
    else:
        self.reportCharacterErrors = self.characterErrorsUCS2
        self.replaceCharactersRegexp = re.compile(eval(u'"([\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?<![\\uD800-\\uDBFF])[\\uDC00-\\uDFFF])"'))
    self.newLines = [0]
    self.charEncoding = (u'utf-8', u'certain')
    self.dataStream = self.openStream(source)
    self.reset()
