Code Duplication    Length = 11-12 lines in 2 locations

src/voku/helper/UTF8.php 2 locations

@@ 2215-2226 (lines=12) @@
2212
    ) {
2213
      self::checkForSupport();
2214
2215
      if (
2216
          $encoding === 'UTF-8'
2217
          &&
2218
          (
2219
              $force === true
2220
              || $encodingDetected === 'UTF-8'
2221
              || $encodingDetected === 'WINDOWS-1252'
2222
              || $encodingDetected === 'ISO-8859-1'
2223
          )
2224
      ) {
2225
        return self::to_utf8($str);
2226
      }
2227
2228
      if (
2229
          $encoding === 'ISO-8859-1'
@@ 2228-2238 (lines=11) @@
2225
        return self::to_utf8($str);
2226
      }
2227
2228
      if (
2229
          $encoding === 'ISO-8859-1'
2230
          &&
2231
          (
2232
              $force === true
2233
              || $encodingDetected === 'ISO-8859-1'
2234
              || $encodingDetected === 'UTF-8'
2235
          )
2236
      ) {
2237
        return self::to_win1252($str);
2238
      }
2239
2240
      $strEncoded = \mb_convert_encoding(
2241
          $str,