/** * Returns the EncodingInfo object for the specified * encoding, never null, although the encoding name * inside the returned EncodingInfo object will be if * we can't find a "real" EncodingInfo for the encoding. * <p> * This is not a public API. * * @param encoding The encoding * @return The object that is used to determine if * characters are in the given encoding. * @xsl.usage internal */ static EncodingInfo getEncodingInfo(String encoding) { EncodingInfo ei; String normalizedEncoding = toUpperCaseFast(encoding); ei = (EncodingInfo) _encodingTableKeyJava.get(normalizedEncoding); if (ei == null) ei = (EncodingInfo) _encodingTableKeyMime.get(normalizedEncoding); if (ei == null) { // We shouldn't have to do this, but just in case. ei = new EncodingInfo(null,null, '\u0000'); } return ei; }
/** * Characters with values at or below the high code point are * in the encoding. Code point values above this one may or may * not be in the encoding, but lower ones certainly are. * <p> * This is for performance. * * @param encoding The encoding * @return The code point for which characters at or below this code point * are in the encoding. Characters with higher code point may or may not be * in the encoding. A value of zero is returned if the high code point is unknown. * <p> * This method is not a public API. * @xsl.usage internal */ static public char getHighChar(String encoding) { final char highCodePoint; EncodingInfo ei; String normalizedEncoding = toUpperCaseFast(encoding); ei = (EncodingInfo) _encodingTableKeyJava.get(normalizedEncoding); if (ei == null) ei = (EncodingInfo) _encodingTableKeyMime.get(normalizedEncoding); if (ei != null) highCodePoint = ei.getHighChar(); else highCodePoint = 0; return highCodePoint; }
isInEncoding = inEncoding(ch, bArray);
/** * Tell if this character can be written without escaping. */ protected boolean escapingNotNeeded(char ch) { final boolean ret; if (ch < 127) { // This is the old/fast code here, but is this // correct for all encodings? if (ch >= CharInfo.S_SPACE || (CharInfo.S_LINEFEED == ch || CharInfo.S_CARRIAGERETURN == ch || CharInfo.S_HORIZONAL_TAB == ch)) ret= true; else ret = false; } else { ret = m_encodingInfo.isInEncoding(ch); } return ret; }
else if (m_encodingInfo.isInEncoding(ch)) {
if (m_encodingInfo.isInEncoding(c,low)) {
EncodingInfo ei = new EncodingInfo(mimeName, javaName, highChar); encodingInfo_list.add(ei); _encodingTableKeyMime.put(mimeName.toUpperCase(), ei);
isInEncoding = inEncoding(high,bArray); } catch (Exception e) { isInEncoding = false;
/** * Characters with values at or below the high code point are * in the encoding. Code point values above this one may or may * not be in the encoding, but lower ones certainly are. * <p> * This is for performance. * * @param encoding The encoding * @return The code point for which characters at or below this code point * are in the encoding. Characters with higher code point may or may not be * in the encoding. A value of zero is returned if the high code point is unknown. * <p> * This method is not a public API. * @xsl.usage internal */ static public char getHighChar(String encoding) { final char highCodePoint; EncodingInfo ei; String normalizedEncoding = toUpperCaseFast(encoding); ei = (EncodingInfo) _encodingTableKeyJava.get(normalizedEncoding); if (ei == null) ei = (EncodingInfo) _encodingTableKeyMime.get(normalizedEncoding); if (ei != null) highCodePoint = ei.getHighChar(); else highCodePoint = 0; return highCodePoint; }
writer.write(m_lineSep, 0, m_lineSepLen); } else if (m_encodingInfo.isInEncoding(c)) { writer.write(c);
EncodingInfo m_encodingInfo = new EncodingInfo(null,null, '\u0000');
isInEncoding = inEncoding(high,bArray); } catch (Exception e) { isInEncoding = false;
/** * Characters with values at or below the high code point are * in the encoding. Code point values above this one may or may * not be in the encoding, but lower ones certainly are. * <p> * This is for performance. * * @param encoding The encoding * @return The code point for which characters at or below this code point * are in the encoding. Characters with higher code point may or may not be * in the encoding. A value of zero is returned if the high code point is unknown. * <p> * This method is not a public API. * @xsl.usage internal */ static public char getHighChar(String encoding) { final char highCodePoint; EncodingInfo ei; String normalizedEncoding = toUpperCaseFast(encoding); ei = (EncodingInfo) _encodingTableKeyJava.get(normalizedEncoding); if (ei == null) ei = (EncodingInfo) _encodingTableKeyMime.get(normalizedEncoding); if (ei != null) highCodePoint = ei.getHighChar(); else highCodePoint = 0; return highCodePoint; }
lastDirtyCharProcessed = i; else if (m_encodingInfo.isInEncoding(ch)) {
/** * Returns the EncodingInfo object for the specified * encoding, never null, although the encoding name * inside the returned EncodingInfo object will be if * we can't find a "real" EncodingInfo for the encoding. * <p> * This is not a public API. * * @param encoding The encoding * @return The object that is used to determine if * characters are in the given encoding. * @xsl.usage internal */ static EncodingInfo getEncodingInfo(String encoding) { EncodingInfo ei; String normalizedEncoding = toUpperCaseFast(encoding); ei = (EncodingInfo) _encodingTableKeyJava.get(normalizedEncoding); if (ei == null) ei = (EncodingInfo) _encodingTableKeyMime.get(normalizedEncoding); if (ei == null) { // We shouldn't have to do this, but just in case. ei = new EncodingInfo(null,null, '\u0000'); } return ei; }
isInEncoding = inEncoding(high,bArray); } catch (Exception e) { isInEncoding = false;
/** * Characters with values at or below the high code point are * in the encoding. Code point values above this one may or may * not be in the encoding, but lower ones certainly are. * <p> * This is for performance. * * @param encoding The encoding * @return The code point for which characters at or below this code point * are in the encoding. Characters with higher code point may or may not be * in the encoding. A value of zero is returned if the high code point is unknown. * <p> * This method is not a public API. * @xsl.usage internal */ static public char getHighChar(String encoding) { final char highCodePoint; EncodingInfo ei; String normalizedEncoding = toUpperCaseFast(encoding); ei = (EncodingInfo) _encodingTableKeyJava.get(normalizedEncoding); if (ei == null) ei = (EncodingInfo) _encodingTableKeyMime.get(normalizedEncoding); if (ei != null) highCodePoint = ei.getHighChar(); else highCodePoint = 0; return highCodePoint; }
/** * Tell if this character can be written without escaping. */ protected boolean escapingNotNeeded(char ch) { final boolean ret; if (ch < 127) { // This is the old/fast code here, but is this // correct for all encodings? if (ch >= CharInfo.S_SPACE || (CharInfo.S_LINEFEED == ch || CharInfo.S_CARRIAGERETURN == ch || CharInfo.S_HORIZONAL_TAB == ch)) ret= true; else ret = false; } else { ret = m_encodingInfo.isInEncoding(ch); } return ret; }
/** * Returns the EncodingInfo object for the specified * encoding, never null, although the encoding name * inside the returned EncodingInfo object will be if * we can't find a "real" EncodingInfo for the encoding. * <p> * This is not a public API. * * @param encoding The encoding * @return The object that is used to determine if * characters are in the given encoding. * @xsl.usage internal */ static EncodingInfo getEncodingInfo(String encoding) { EncodingInfo ei; String normalizedEncoding = toUpperCaseFast(encoding); ei = (EncodingInfo) _encodingTableKeyJava.get(normalizedEncoding); if (ei == null) ei = (EncodingInfo) _encodingTableKeyMime.get(normalizedEncoding); if (ei == null) { // We shouldn't have to do this, but just in case. ei = new EncodingInfo(null,null, '\u0000'); } return ei; }
isInEncoding = inEncoding(high,bArray); } catch (Exception e) { isInEncoding = false;