public static function ConvertEncoding($value, $to, $from)
	{
		if (self::getIsIconvEnabled()) {
			return iconv($from, $to, $value);
		}

		if (self::getIsMbstringEnabled()) {
			return mb_convert_encoding($value, $to, $from);
		}

		if($from == 'UTF-16LE'){
			return self::utf16_decode($value, false);
		}else if($from == 'UTF-16BE'){
			return self::utf16_decode($value);
		}
		// else, no conversion
		return $value;
	}
public static function ConvertEncoding($value, $to, $from)
	{
		if (self::getIsIconvEnabled()) {
			return iconv($from, $to, $value);
		}

		if (self::getIsMbstringEnabled()) {
			return mb_convert_encoding($value, $to, $from);
		}

		if($from == 'UTF-16LE'){
			return self::utf16_decode($value, false);
		}else if($from == 'UTF-16BE'){
			return self::utf16_decode($value);
		}
		// else, no conversion
		return $value;
	}
public static function ConvertEncoding ( $ value , $ to , $ from ) { if ( self :: getIsIconvEnabled ( ) ) { return iconv ( $ from , $ to , $ value ) ; } if ( self :: getIsMbstringEnabled ( ) ) { return mb_convert_encoding ( $ value , $ to , $ from ) ; } if ( $ from == 'UTF-16LE' ) { return self :: utf16_decode ( $ value , false ) ; } else if ( $ from == 'UTF-16BE' ) { return self :: utf16_decode ( $ value ) ; } // else, no conversion return $ value ; }
Convert string from one encoding to another. First try mbstring, then iconv, finally strlen

@param string $value
@param string $to Encoding to convert to, e.g. 'UTF-8'
@param string $from Encoding to convert from, e.g. 'UTF-16LE'
@return string
Convert string from one encoding to another . First try mbstring then iconv finally strlen