Code Duplication    Length = 11-12 lines in 2 locations

src/voku/helper/UTF8.php 2 locations

@@ 2187-2198 (lines=12) @@
2184
    ) {
2185
      self::checkForSupport();
2186
2187
      if (
2188
          $encoding === 'UTF-8'
2189
          &&
2190
          (
2191
              $force === true
2192
              || $encodingDetected === 'UTF-8'
2193
              || $encodingDetected === 'WINDOWS-1252'
2194
              || $encodingDetected === 'ISO-8859-1'
2195
          )
2196
      ) {
2197
        return self::to_utf8($str);
2198
      }
2199
2200
      if (
2201
          $encoding === 'ISO-8859-1'
@@ 2200-2210 (lines=11) @@
2197
        return self::to_utf8($str);
2198
      }
2199
2200
      if (
2201
          $encoding === 'ISO-8859-1'
2202
          &&
2203
          (
2204
              $force === true
2205
              || $encodingDetected === 'ISO-8859-1'
2206
              || $encodingDetected === 'UTF-8'
2207
          )
2208
      ) {
2209
        return self::to_win1252($str);
2210
      }
2211
2212
      $strEncoded = \mb_convert_encoding(
2213
          $str,