protected function convertCharset($from, $to, $str)
    {
        if (function_exists('mb_convert_encoding')) {
            return mb_convert_encoding($str, $to, $from);
        } else if (function_exists('iconv')) {
            return iconv($from, $to, $str);
        }
        return $str;
    }
protected function convertCharset($from, $to, $str)
    {
        if (function_exists('mb_convert_encoding')) {
            return mb_convert_encoding($str, $to, $from);
        } else if (function_exists('iconv')) {
            return iconv($from, $to, $str);
        }
        return $str;
    }
protected function convertCharset ( $ from , $ to , $ str ) { if ( function_exists ( 'mb_convert_encoding' ) ) { return mb_convert_encoding ( $ str , $ to , $ from ) ; } else if ( function_exists ( 'iconv' ) ) { return iconv ( $ from , $ to , $ str ) ; } return $ str ; }
Convert the given string from one into another charset.
Uses mb_convert_encoding or iconv if available.

@param string $from Source charset the string is in
@param string $to   Target character set
@param string $str  String to convert

@return string converted string
Convert the given string from one into another charset . Uses mb_convert_encoding or iconv if available .