public static function strpos($haystack, $needle, $offset = 0) {
    if (static::getStatus() == static::STATUS_MULTIBYTE) {
      return mb_strpos($haystack, $needle, $offset);
    }
    else {
      // Remove Unicode continuation characters, to be compatible with
      // Unicode::strlen() and Unicode::substr().
      $haystack = preg_replace("/[\x80-\xBF]/", '', $haystack);
      $needle = preg_replace("/[\x80-\xBF]/", '', $needle);
      return strpos($haystack, $needle, $offset);
    }
  }