Index: src/java/org/apache/lucene/search/AutomatonTermsEnum.java
===================================================================
--- src/java/org/apache/lucene/search/AutomatonTermsEnum.java	(revision 909391)
+++ src/java/org/apache/lucene/search/AutomatonTermsEnum.java	(working copy)
@@ -187,8 +187,7 @@
   @Override
   protected AcceptStatus accept(final BytesRef term) {
     if (term.endsWith(commonSuffixRef)) {
-      UnicodeUtil.UTF8toUTF16(term.bytes, term.offset, term.length, utf16);
-      return runAutomaton.run(utf16.result, 0, utf16.length) ? YES_MATCH : NO_MATCH;
+      return runAutomaton.run(term.bytes, term.offset, term.length) ? YES_MATCH : NO_MATCH;
     } else {
       return NO_MATCH;
     }
Index: src/java/org/apache/lucene/util/automaton/RunAutomaton.java
===================================================================
--- src/java/org/apache/lucene/util/automaton/RunAutomaton.java	(revision 909391)
+++ src/java/org/apache/lucene/util/automaton/RunAutomaton.java	(working copy)
@@ -27,6 +27,31 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+/* Support for RunAutomaton.run(byte[]) is derived from Bjoern Hoermann's 
+ * UTF-8 decoder. Full copyright for that code follows:
+ */
+
+/*
+ * Copyright (c) 2008-2009 Bjoern Hoehrmann <bjoern@hoehrmann.de>
+ * 
+ * Permission is hereby granted, free of charge, to any person obtaining a 
+ * copy of this software and associated documentation files (the "Software"), 
+ * to deal in the Software without restriction, including without limitation 
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, 
+ * and/or sell copies of the Software, and to permit persons to whom the 
+ * Software is furnished to do so, subject to the following conditions:
+ * 
+ * The above copyright notice and this permission notice shall be included 
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
+ * DEALINGS IN THE SOFTWARE.
+ */
 package org.apache.lucene.util.automaton;
 
 import java.io.Serializable;
@@ -189,7 +214,64 @@
     return accept[p];
   }
   
+  // Copyright (c) 2008-2009 Bjoern Hoehrmann <bjoern@hoehrmann.de>
+  // See http://bjoern.hoehrmann.de/utf-8/decoder/dfa/ for details.
+
+  private static final byte utf8d[] = {
+    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, // 00..1f
+    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, // 20..3f
+    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, // 40..5f
+    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, // 60..7f
+    1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9, // 80..9f
+    7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, // a0..bf
+    8,8,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, // c0..df
+    0xa,0x3,0x3,0x3,0x3,0x3,0x3,0x3,0x3,0x3,0x3,0x3,0x3,0x4,0x3,0x3, // e0..ef
+    0xb,0x6,0x6,0x6,0x5,0x8,0x8,0x8,0x8,0x8,0x8,0x8,0x8,0x8,0x8,0x8, // f0..ff
+    0x0,0x1,0x2,0x3,0x5,0x8,0x7,0x1,0x1,0x1,0x4,0x6,0x1,0x1,0x1,0x1, // s0..s0
+    1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,0,1,0,1,1,1,1,1,1, // s1..s2
+    1,2,1,1,1,1,1,2,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,1, // s3..s4
+    1,2,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,3,1,3,1,1,1,1,1,1, // s5..s6
+    1,3,1,1,1,1,1,3,1,3,1,1,1,1,1,1,1,3,1,1,1,1,1,1,1,1,1,1,1,1,1,1, // s7..s8
+  };
+
   /**
+   * Returns true if the given array of UTF-8 bytes is accepted by this automaton
+   */
+  public boolean run(byte[] s, int offset, int length) {
+    int p = initial;
+    int l = offset + length;
+    int uState = 0;
+    int codepoint = 0;
+    for (int i = offset; i < l; i++) {
+      final int b = s[i] & 0xff;
+      if (uState != 0) {
+        final int type = utf8d[b];
+        codepoint = (codepoint << 6) | (b & 63);
+        uState = utf8d[256 + uState*16 + type];
+        if (uState == 0) {
+          if (codepoint > 0xffff) {
+            p = step(p, (char)(0xD7C0 + (codepoint >> 10)));
+            if (p == -1) return false;
+            p = step(p, (char)(0xDC00 + (codepoint & 0x3FF)));
+            if (p == -1) return false;
+          } else {
+            p = step(p, (char)codepoint);
+            if (p == -1) return false;
+          }
+        }
+      } else if (b > 0x7f) {
+        final int type = utf8d[b];
+        codepoint = (b) & (255 >> type);
+        uState = utf8d[256 + type];
+      } else {
+        p = step(p, (char) b);
+        if (p == -1) return false;
+      }
+    }
+    return accept[p];
+  }
+  
+  /**
    * Returns the length of the longest accepted run of the given string starting
    * at the given offset.
    * 
Index: NOTICE.txt
===================================================================
--- NOTICE.txt	(revision 909391)
+++ NOTICE.txt	(working copy)
@@ -36,3 +36,6 @@
 
 Brics Automaton (under src/java/org/apache/lucene/util/automaton) is 
 BSD-licensed, created by Anders Møller. See http://www.brics.dk/automaton/
+
+The UTF-8 DFA decoder(under src/java/org/apache/lucene/util/automaton) is
+BSD-licensed, created by Bjoern Hoehrmann. See http://bjoern.hoehrmann.de/utf-8/decoder/dfa/
