Code Duplication    Length = 11-12 lines in 2 locations

src/voku/helper/UTF8.php 2 locations

@@ 2200-2211 (lines=12) @@
2197
    ) {
2198
      self::checkForSupport();
2199
2200
      if (
2201
          $encoding === 'UTF-8'
2202
          &&
2203
          (
2204
              $force === true
2205
              || $encodingDetected === 'UTF-8'
2206
              || $encodingDetected === 'WINDOWS-1252'
2207
              || $encodingDetected === 'ISO-8859-1'
2208
          )
2209
      ) {
2210
        return self::to_utf8($str);
2211
      }
2212
2213
      if (
2214
          $encoding === 'ISO-8859-1'
@@ 2213-2223 (lines=11) @@
2210
        return self::to_utf8($str);
2211
      }
2212
2213
      if (
2214
          $encoding === 'ISO-8859-1'
2215
          &&
2216
          (
2217
              $force === true
2218
              || $encodingDetected === 'ISO-8859-1'
2219
              || $encodingDetected === 'UTF-8'
2220
          )
2221
      ) {
2222
        return self::to_win1252($str);
2223
      }
2224
2225
      $strEncoded = \mb_convert_encoding(
2226
          $str,