Index: apachesolr.index.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/apachesolr/apachesolr.index.inc,v
retrieving revision 1.1.2.5
diff -u -p -r1.1.2.5 apachesolr.index.inc
--- apachesolr.index.inc	19 May 2009 19:58:23 -0000	1.1.2.5
+++ apachesolr.index.inc	1 Jul 2009 19:33:49 -0000
@@ -28,14 +28,13 @@ function apachesolr_strip_ctl_chars($tex
  * Strip html tags and also control characters that cause Jetty/Solr to fail.
  */
 function apachesolr_clean_text($text) {
-  return _apachesolr_strip_decode(preg_replace('@[\x00-\x08\x0B\x0C\x0E-\x1F]@', ' ', $text));
-}
-
-function _apachesolr_strip_decode($text) {
   // Add spaces before stripping tags to avoid running words together.
   $text = filter_xss(str_replace(array('<', '>'), array(' <', '> '), $text), array());
   // Decode entities and then make safe any < or > characters.
-  return htmlspecialchars(html_entity_decode($text, ENT_NOQUOTES, 'UTF-8'), ENT_NOQUOTES, 'UTF-8');
+  $text = htmlspecialchars(html_entity_decode($text, ENT_NOQUOTES, 'UTF-8'), ENT_NOQUOTES, 'UTF-8');
+  // We must strip low bytes second in case there was an encoded
+  // low-byte character.
+  return apachesolr_strip_ctl_chars($text);
 }
 
 /**
@@ -88,7 +87,7 @@ function apachesolr_node_to_document($ni
     if (!empty($node->language)) {
       $document->language = $node->language;
     }
-    $document->body = _apachesolr_strip_decode($text);
+    $document->body = apachesolr_clean_text($text);
     $document->type  = $node->type;
     $document->type_name = apachesolr_strip_ctl_chars(node_get_types('name', $node));
     $document->created = apachesolr_date_iso($node->created);
