diff --git a/search_api_db.test b/search_api_db.test
index f169a4e..ea6598e 100644
--- a/search_api_db.test
+++ b/search_api_db.test
@@ -930,8 +930,10 @@ protected function regressionTests2() {
     $this->indexItems();
 
     $this->drupalGet('search_api_test/insert');
+    $mb_string = 'äöüßáŧæøðđŋħĸµÄÖÜŁŦ¥ØÞĦŊÐẞÆ©';
     $this->insertItem(array(
       'id' => 6,
+      'body' => $mb_string,
       'prices' => '3.5,3.25,3.75,3.5',
     ));
 
@@ -946,6 +948,20 @@ protected function regressionTests2() {
     $this->assertEqual($results['result count'], 1, 'Filter on decimal field returned correct number of results.');
     $this->assertEqual(array_keys($results['results']), array(6), 'Filter on decimal field returned correct result.');
     $this->assertEqual($results['warnings'], array(), 'No warnings were displayed.');
+
+    // Regression test for #2616804.
+    // The word has 25 Unicode characters but 75 bytes. Verify that it was still
+    // indexed correctly.
+    $query = $this->buildSearch($mb_string);
+    $results = $query->execute();
+    $this->assertEqual($results['result count'], 1, 'Search for word with 27 multi-byte characters returned correct number of results.');
+    $this->assertEqual(array_keys($results['results']), array(6), 'Search for word with 27 multi-byte characters returned correct result.');
+    $this->assertEqual($results['warnings'], array(), 'No warnings were displayed.');
+
+    $query = $this->buildSearch($mb_string . 'ä');
+    $results = $query->execute();
+    $this->assertEqual($results['result count'], 0, 'Search for unknown word with 28 multi-byte characters returned no results.');
+    $this->assertEqual($results['warnings'], array(), 'No warnings were displayed.');
   }
 
   /**
diff --git a/service.inc b/service.inc
index c9620ce..65d10a8 100644
--- a/service.inc
+++ b/service.inc
@@ -1036,9 +1036,9 @@ protected function convert($value, $type, $original_type, SearchApiIndex $index)
             // Check for over-long tokens.
             $score = $v['score'];
             $v = $v['value'];
-            if (strlen($v) > 50) {
+            if (drupal_strlen($v) > 50) {
               $words = preg_split('/[^\p{L}\p{N}]+/u', $v, -1, PREG_SPLIT_NO_EMPTY);
-              if (count($words) > 1 && max(array_map('strlen', $words)) <= 50) {
+              if (count($words) > 1 && max(array_map('drupal_strlen', $words)) <= 50) {
                 // Overlong token is due to bad tokenizing.
                 // Check for "Tokenizer" preprocessor on index.
                 if (empty($index->options['processors']['search_api_tokenizer']['status'])) {
@@ -1055,11 +1055,11 @@ protected function convert($value, $type, $original_type, SearchApiIndex $index)
 
               $tokens = array();
               foreach ($words as $word) {
-                if (strlen($word) > 50) {
+                if (drupal_strlen($word) > 50) {
                   watchdog('search_api_db', 'An overlong word (more than 50 characters) was encountered while indexing: %word.<br />' .
                       'Database search servers currently cannot index such words correctly – the word was therefore trimmed to the allowed length.',
                       array('%word' => $word), WATCHDOG_WARNING);
-                  $word = self::mbStrcut($word, 0, 50);
+                  $word = drupal_substr($word, 0, 50);
                 }
                 $tokens[] = array(
                   'value' => $word,
@@ -1080,8 +1080,8 @@ protected function convert($value, $type, $original_type, SearchApiIndex $index)
         if ($original_type == 'date') {
           return date('c', $value);
         }
-        if (strlen($value) > 255) {
-          $value = self::mbStrcut($value, 0, 255);
+        if (drupal_strlen($value) > 255) {
+          $value = drupal_substr($value, 0, 255);
           watchdog('search_api_db', 'An overlong value (more than 255 characters) was encountered while indexing: %value.<br />' .
               'Database search servers currently cannot index such values correctly – the value was therefore trimmed to the allowed length.',
               array('%value' => $value), WATCHDOG_WARNING);
