Code Duplication    Length = 11-11 lines in 2 locations

src/voku/helper/UTF8.php 2 locations

@@ 5439-5449 (lines=11) @@
5436
      self::checkForSupport();
5437
    }
5438
5439
    if (self::$support['mbstring'] === true) {
5440
5441
      // INFO: this is only a fallback for old versions
5442
      if ($encoding === 'UTF-8' || $encoding === true || $encoding === false) {
5443
        $encoding = 'UTF-8';
5444
      } else {
5445
        $encoding = self::normalize_encoding($encoding);
5446
      }
5447
5448
      return \mb_strpos($haystack, $needle, $offset, $encoding);
5449
    }
5450
5451
    if (self::$support['iconv'] === true) {
5452
      // ignore invalid negative offset to keep compatility
@@ 5962-5972 (lines=11) @@
5959
      self::checkForSupport();
5960
    }
5961
5962
    if (self::$support['mbstring'] === true) {
5963
5964
      // INFO: this is only a fallback for old versions
5965
      if ($encoding === 'UTF-8' || $encoding === true || $encoding === false) {
5966
        $encoding = 'UTF-8';
5967
      } else {
5968
        $encoding = self::normalize_encoding($encoding);
5969
      }
5970
5971
      return \mb_substr($str, $start, $length, $encoding);
5972
    }
5973
5974
    if (self::$support['iconv'] === true) {
5975
      return (string)\grapheme_substr($str, $start, $length);