Code Duplication    Length = 11-12 lines in 2 locations

src/voku/helper/UTF8.php 2 locations

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