/** * Converts characters above ASCII to their ASCII equivalents. For example, * accents are removed from accented characters. * @param input The string to fold * @param length The number of characters in the input string */ public void foldToASCII(final char[] input, final int length) { // Worst-case length required: final int maxSizeNeeded = 4 * length; this.growBuffer(output, maxSizeNeeded); outputPos = foldToASCII(input, 0, output, 0, length); }
final char c = buffer[i]; if (c >= '\u0080') { this.foldToASCII(buffer, length); termAtt.copyBuffer(output, 0, outputPos); savedState = true;