Code Duplication    Length = 11-12 lines in 2 locations

src/voku/helper/UTF8.php 2 locations

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