diff -upr modules/search.orig//search.module modules/search//search.module
--- modules/search.orig//search.module	2011-08-31 22:55:34.000000000 +0400
+++ modules/search//search.module	2011-09-21 23:52:29.149632002 +0400
@@ -1184,7 +1184,7 @@ function search_excerpt($keys, $text) {
       // Note that a space was added to the front and end of $text above.
       if ($p) {
         if (($q = strpos(' ' . $text, ' ', max(0, $p - 61))) !== FALSE) {
-          $end = substr($text . ' ', $p, 80);
+          $end = drupal_substr(substr($text . ' ', $p), 0, 80);
           if (($s = strrpos($end, ' ')) !== FALSE) {
             // Account for the added spaces.
             $q = max($q - 1, 0);
@@ -1239,7 +1239,7 @@ function search_excerpt($keys, $text) {
   // Fetch text
   $out = array();
   foreach ($newranges as $from => $to) {
-    $out[] = substr($text, $from, $to - $from);
+    $out[] = drupal_substr($text, $from, $to - $from);
   }
 
   // Let translators have the ... separator text as one chunk.
