// If the specified encoding wasn't a recognized IANA encoding throw an IOException.
// The XIncludeHandler will report this as a ResourceError and then will
// attempt to include a fallback if there is one.
if (javaEncoding == null) {
MessageFormatter aFormatter =
fErrorReporter.getMessageFormatter(XMLMessageFormatter.XML_DOMAIN);
Locale aLocale = fErrorReporter.getLocale();
throw new IOException( aFormatter.formatMessage( aLocale,
"EncodingDeclInvalid",
new Object[] {encoding} ) );
}
else if (javaEncoding.equals("ASCII")) {
return new ASCIIReader(stream,