/** * Initializes a decoder from external decl. */ protected Encoding encodingFromExternalDeclaration(String encoding) throws SAXException { if (encoding == null) { return null; } encoding = Encoding.toAsciiLowerCase(encoding); try { Encoding cs = Encoding.forName(encoding); if ("utf-16".equals(cs.getCanonName()) || "utf-32".equals(cs.getCanonName())) { swallowBom = false; } return whineAboutEncodingAndReturnActual(encoding, cs); } catch (UnsupportedCharsetException e) { tokenizer.err("Unsupported character encoding name: \u201C" + encoding + "\u201D. Will sniff."); swallowBom = true; } return null; // keep the compiler happy }
/** * Initializes a decoder from external decl. */ protected Encoding encodingFromExternalDeclaration(String encoding) throws SAXException { if (encoding == null) { return null; } encoding = Encoding.toAsciiLowerCase(encoding); try { Encoding cs = Encoding.forName(encoding); if ("utf-16".equals(cs.getCanonName()) || "utf-32".equals(cs.getCanonName())) { swallowBom = false; } return whineAboutEncodingAndReturnActual(encoding, cs); } catch (UnsupportedCharsetException e) { tokenizer.err("Unsupported character encoding name: \u201C" + encoding + "\u201D. Will sniff."); swallowBom = true; } return null; // keep the compiler happy }
/** * Initializes a decoder from external decl. */ protected Encoding encodingFromExternalDeclaration(String encoding) throws SAXException { if (encoding == null) { return null; } encoding = Encoding.toAsciiLowerCase(encoding); try { Encoding cs = Encoding.forName(encoding); if ("utf-16".equals(cs.getCanonName()) || "utf-32".equals(cs.getCanonName())) { swallowBom = false; } return whineAboutEncodingAndReturnActual(encoding, cs); } catch (UnsupportedCharsetException e) { tokenizer.err("Unsupported character encoding name: \u201C" + encoding + "\u201D. Will sniff."); swallowBom = true; } return null; // keep the compiler happy }
+ characterEncoding.getCanonName() + "\u201D)."); } else { Encoding newEnc = whineAboutEncodingAndReturnActual( internalCharset, cs); tokenizer.errTreeBuilder("Changing character encoding \u201C"
+ characterEncoding.getCanonName() + "\u201D)."); } else { Encoding newEnc = whineAboutEncodingAndReturnActual( internalCharset, cs); tokenizer.errTreeBuilder("Changing character encoding \u201C"
+ characterEncoding.getCanonName() + "\u201D)."); } else { Encoding newEnc = whineAboutEncodingAndReturnActual( internalCharset, cs); tokenizer.errTreeBuilder("Changing character encoding \u201C"