Index: src/java/org/apache/lucene/analysis/ASCIIFoldingFilter.java
===================================================================
--- src/java/org/apache/lucene/analysis/ASCIIFoldingFilter.java	(revision 921328)
+++ src/java/org/apache/lucene/analysis/ASCIIFoldingFilter.java	(working copy)
@@ -105,9 +105,24 @@
       output = new char[ArrayUtil.oversize(maxSizeNeeded, RamUsageEstimator.NUM_BYTES_CHAR)];
     }
 
-    outputPos = 0;
+    outputPos = foldToASCII(input, 0, length, output);
+  }
 
-    for (int pos = 0 ; pos < length ; ++pos) {
+  /**
+   * Converts characters above ASCII to their ASCII equivalents.  For example,
+   * accents are removed from accented characters.
+   * @param input The characters to fold
+   * @param offset Index of the first character to fold
+   * @param length The number of characters to fold
+   * @param output The result of the folding. Should be of size >= {@code outputPos + 4}.
+   * @return length of output
+   */
+  public static final int foldToASCII(char input[], int offset, int length, char output[])
+  {
+    int outputPos = 0;
+
+    final int end = offset + length;
+    for (int pos = offset; pos < end ; ++pos) {
       final char c = input[pos];
 
       // Quick test: if it's not in range then just keep current character
@@ -2028,5 +2043,6 @@
         }
       }
     }
+    return outputPos;
   }
 }
