protected function convertStringEncoding($string, $fromEncoding, $toEncoding) {
		$convertedString = null;
		if($string && $fromEncoding != $toEncoding) {
			$convertedString = @iconv($fromEncoding, $toEncoding . '//IGNORE', $string);
			if(!$convertedString && extension_loaded('mbstring')) {
				$convertedString = @mb_convert_encoding($string, $toEncoding, $fromEncoding);
			}
		}
		return $convertedString ?: $string;
	}
protected function convertStringEncoding($string, $fromEncoding, $toEncoding) {
		$convertedString = null;
		if($string && $fromEncoding != $toEncoding) {
			$convertedString = @iconv($fromEncoding, $toEncoding . '//IGNORE', $string);
			if(!$convertedString && extension_loaded('mbstring')) {
				$convertedString = @mb_convert_encoding($string, $toEncoding, $fromEncoding);
			}
		}
		return $convertedString ?: $string;
	}
protected function convertStringEncoding ( $ string , $ fromEncoding , $ toEncoding ) { $ convertedString = null ; if ( $ string && $ fromEncoding != $ toEncoding ) { $ convertedString = @ iconv ( $ fromEncoding , $ toEncoding . '//IGNORE' , $ string ) ; if ( ! $ convertedString && extension_loaded ( 'mbstring' ) ) { $ convertedString = @ mb_convert_encoding ( $ string , $ toEncoding , $ fromEncoding ) ; } } return $ convertedString ? : $ string ; }
Converts a string from one encoding to another.
@param string $string
@param string $fromEncoding
@param string $toEncoding
@return string Converted string if conversion was successful, or the original string if not
Converts a string from one encoding to another .