original_string: protected function convertCharset($string, $charsets)
      {
          if (function_exists('iconv')
              && !empty($charsets)
          ) {
              $charset = $charsets[0];
              if (count($charsets) > 1
                  && function_exists('mb_detect_encoding')
              ) {
                  $charset = mb_detect_encoding($string, $charsets);
                  if ($charset === false) {
                      $charset = $charsets[0];
                  }
              }
  
              $newKey = @iconv($charset, 'UTF-8//IGNORE', $string);
              if (!empty($newKey)) {
                  $string = $newKey;
              }
          }
  
          return $string;
      }
code: protected function convertCharset($string, $charsets)
      {
          if (function_exists('iconv')
              && !empty($charsets)
          ) {
              $charset = $charsets[0];
              if (count($charsets) > 1
                  && function_exists('mb_detect_encoding')
              ) {
                  $charset = mb_detect_encoding($string, $charsets);
                  if ($charset === false) {
                      $charset = $charsets[0];
                  }
              }
  
              $newKey = @iconv($charset, 'UTF-8//IGNORE', $string);
              if (!empty($newKey)) {
                  $string = $newKey;
              }
          }
  
          return $string;
      }
code_tokens: protected function convertCharset ( $ string , $ charsets ) { if ( function_exists ( 'iconv' ) && ! empty ( $ charsets ) ) { $ charset = $ charsets [ 0 ] ; if ( count ( $ charsets ) > 1 && function_exists ( 'mb_detect_encoding' ) ) { $ charset = mb_detect_encoding ( $ string , $ charsets ) ; if ( $ charset === false ) { $ charset = $ charsets [ 0 ] ; } } $ newKey = @ iconv ( $ charset , 'UTF-8//IGNORE' , $ string ) ; if ( ! empty ( $ newKey ) ) { $ string = $ newKey ; } } return $ string ; }
docstring: Tries to convert the given string from one of the given charsets to UTF-8
  @param string $string
  @param array $charsets
  @return string
docstring_tokens: Tries to convert the given string from one of the given charsets to UTF - 8