The encoding must be a string acceptable for an XML encoding declaration (see section 4.3.3 of the XML recommendation).
The encoding attribute of the InputSource is ignored if the InputSource also contains a character stream.
The SAX parser will ignore this if there is also a character stream specified, but it will use a byte stream in preference to opening a URI connection itself.
If the application knows the character encoding of the byte stream, it should set it with the setEncoding method.
The getEncoding method will return the character encoding for this byte stream, or None if unknown.
If there is a character stream specified, the SAX parser will ignore any byte stream and will not attempt to open a URI connection to the system identifier.