Code Duplication    Length = 11-12 lines in 2 locations

src/voku/helper/UTF8.php 2 locations

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