CurlSharp.NativeMethods.curl_unescape C# (CSharp) Method

curl_unescape() private method

private curl_unescape ( String url, int length ) : IntPtr
url String
length int
return System.IntPtr
		internal static extern IntPtr curl_unescape (String url, int length);

Usage Example

Ejemplo n.º 1
0
        /// <summary>
        ///     URL decode a String.
        /// </summary>
        /// <param name="url">The string to URL decode.</param>
        /// <param name="length">
        ///     Input string length;
        ///     use 0 for cURL to determine.
        /// </param>
        /// <returns>A new URL decoded string.</returns>
        /// <exception cref="System.InvalidOperationException">
        ///     Thrown if cURL isn't properly initialized.
        /// </exception>
        public static string Unescape(string url, int length)
        {
            EnsureCurl();
            var p = NativeMethods.curl_unescape(url, length);
            var s = Marshal.PtrToStringAnsi(p);

            NativeMethods.curl_free(p);
            return(s);
        }