def __init__(self, source):
if not _utils.supports_lone_surrogates:<EOL><INDENT>self.reportCharacterErrors = None<EOL><DEDENT>elif len("<STR_LIT>") == <NUM_LIT:1>:<EOL><INDENT>self.reportCharacterErrors = self.characterErrorsUCS4<EOL><DEDENT>else:<EOL><INDENT>self.reportCharacterErrors = self.characterErrorsUCS2<EOL><DEDENT>self.newLines = [<NUM_LIT:0>]<EOL>self.charEncoding = (lookupEncoding("<STR_LIT:utf-8>"), "<STR_LIT>")<EOL>self.dataStream = self.openStream(source)<EOL>self.reset()<EOL>
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)