public String getCharacterEncoding() throws SAXException { return characterEncoding.getCanonName(); }
public String getCharacterEncoding() throws SAXException { return characterEncoding.getCanonName(); }
public String getCharacterEncoding() throws SAXException { return characterEncoding.getCanonName(); }
public static void main(String[] args) { for (Map.Entry<String, Encoding> entry : encodingByCookedName.entrySet()) { String name = entry.getKey(); Encoding enc = entry.getValue(); System.out.printf( "%21s: canon %21s, obs %5s, reg %5s, asc %5s, ebc %5s\n", name, enc.getCanonName(), enc.isObscure(), enc.isRegistered(), enc.isAsciiSuperset(), enc.isLikelyEbcdic()); } }
public static void main(String[] args) { for (Map.Entry<String, Encoding> entry : encodingByCookedName.entrySet()) { String name = entry.getKey(); Encoding enc = entry.getValue(); System.out.printf( "%21s: canon %21s, obs %5s, reg %5s, asc %5s, ebc %5s\n", name, enc.getCanonName(), enc.isObscure(), enc.isRegistered(), enc.isAsciiSuperset(), enc.isLikelyEbcdic()); } }
public static void main(String[] args) { for (Map.Entry<String, Encoding> entry : encodingByCookedName.entrySet()) { String name = entry.getKey(); Encoding enc = entry.getValue(); System.out.printf( "%21s: canon %21s, obs %5s, reg %5s, asc %5s, ebc %5s\n", name, enc.getCanonName(), enc.isObscure(), enc.isRegistered(), enc.isAsciiSuperset(), enc.isLikelyEbcdic()); } }
/** * 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 }
} else { Encoding cs = Encoding.forName(encoding); String canonName = cs.getCanonName(); if (!cs.isAsciiSuperset()) { err("The encoding \u201C" + "\u201D is not an IANA-registered encoding and did not use the \u201Cx-\u201D prefix. (Charmod C023)"); } else if (!cs.getCanonName().equals(encoding)) { err("The encoding \u201C" + encoding + "\u201D is not the preferred name of the character encoding in use. The preferred name is \u201C" this.characterEncoding = cs; } else { warn("Using \u201C" + actual.getCanonName() + "\u201D instead of the declared encoding \u201C" + encoding + "\u201D."); this.characterEncoding = actual;
} else { Encoding cs = Encoding.forName(encoding); String canonName = cs.getCanonName(); if (!cs.isAsciiSuperset()) { err("The encoding \u201C" + "\u201D is not an IANA-registered encoding and did not use the \u201Cx-\u201D prefix. (Charmod C023)"); } else if (!cs.getCanonName().equals(encoding)) { err("The encoding \u201C" + encoding + "\u201D is not the preferred name of the character encoding in use. The preferred name is \u201C" this.characterEncoding = cs; } else { warn("Using \u201C" + actual.getCanonName() + "\u201D instead of the declared encoding \u201C" + encoding + "\u201D."); this.characterEncoding = actual;
try { Encoding cs = Encoding.forName(encoding); String canonName = cs.getCanonName(); if (requireAsciiSuperset) { if (!cs.isAsciiSuperset()) { if (htmlActual != null) { handler.warn("Documents encoded as \u201C" + htmlActual.getCanonName() + "\u201D are often mislabeled as \u201C" + actualName
} else { Encoding cs = Encoding.forName(encoding); String canonName = cs.getCanonName(); if (!cs.isAsciiSuperset()) { err("The encoding \u201C" + "\u201D is not an IANA-registered encoding and did not use the \u201Cx-\u201D prefix. (Charmod C023)"); } else if (!cs.getCanonName().equals(encoding)) { err("The encoding \u201C" + encoding + "\u201D is not the preferred name of the character encoding in use. The preferred name is \u201C" this.characterEncoding = cs; } else { warn("Using \u201C" + actual.getCanonName() + "\u201D instead of the declared encoding \u201C" + encoding + "\u201D."); this.characterEncoding = actual;
String canonName = cs.getCanonName(); if (!cs.isRegistered()) { if (encoding.startsWith("x-")) { return cs; } else { tokenizer.warn("Using \u201C" + actual.getCanonName() + "\u201D instead of the declared encoding \u201C" + encoding + "\u201D.");
String canonName = cs.getCanonName(); if (!cs.isRegistered()) { if (encoding.startsWith("x-")) { return cs; } else { tokenizer.warn("Using \u201C" + actual.getCanonName() + "\u201D instead of the declared encoding \u201C" + encoding + "\u201D.");
String canonName = cs.getCanonName(); if (!cs.isRegistered()) { if (encoding.startsWith("x-")) { return cs; } else { tokenizer.warn("Using \u201C" + actual.getCanonName() + "\u201D instead of the declared encoding \u201C" + encoding + "\u201D.");
} else if (encoding != Encoding.UTF8) { err("Legacy encoding \u201C" + encoding.getCanonName() + "\u201D used. Documents must use UTF-8."); err("The character encoding was not declared. Proceeding using \u201C" + encoding.getCanonName() + "\u201D."); + encoding.getCanonName() + "\u201D used. Documents must use UTF-8."); if (driver != null) {
+ internalCharset + "\u201D disagrees with the actual encoding of the document (\u201C" + characterEncoding.getCanonName() + "\u201D)."); } else { Encoding newEnc = whineAboutEncodingAndReturnActual(
+ internalCharset + "\u201D disagrees with the actual encoding of the document (\u201C" + characterEncoding.getCanonName() + "\u201D)."); } else { Encoding newEnc = whineAboutEncodingAndReturnActual(
+ internalCharset + "\u201D disagrees with the actual encoding of the document (\u201C" + characterEncoding.getCanonName() + "\u201D)."); } else { Encoding newEnc = whineAboutEncodingAndReturnActual(