encoder class : UrlDecode(string,string) method

Description

Decodes a string using URL encoding and specified character encoding.

Syntax

encoderInstance.UrlDecode(string encodedString, string encodingName)

Arguments

ClassNameDescription
stringencodedStringA string encoded by URL encoding.
stringencodingNameA encoding name.

Return value

ClassDescription
stringA string decoded by URL encoding and specified character encoding..

Sample code

1:

encoder e = new encoder();

2:

string encoded = "%93%FA%96%7B%8C%EA";

3:

string decoded = e.UrlDecode(encoded, "shift_jis"); // The result is "日本語".

Notes

It's a wrapper of the System.Web.HttpUtility.UrlDecode(String,Encoding) method.

Links for reference

Copyright © Cooker All rights reserved.