System
4.0.0.0
System.Object
The class contains encoding and decoding utility methods for use with HTML-encode strings. The class also contains methods and properties that can be used for similar purposes.
Provides methods for encoding and decoding URLs when processing Web requests.
Method
4.0.0.0
System.String
If characters such as blanks and punctuation are passed in an HTTP stream, they might be misinterpreted at the receiving end. HTML encoding converts characters that are not allowed in HTML into character-entity equivalents; HTML decoding reverses the encoding. For example, when embedded in a block of text, the characters < and > are encoded as < and > for HTTP transmission.
If the parameter is null, then the returned decoded string is null. If the parameter is an empty string, then the returned decoded string is an empty string.
Converts a string that has been HTML-encoded for HTTP transmission into a decoded string.
A decoded string.
The string to decode.
Method
4.0.0.0
System.Void
If characters such as blanks and punctuation are passed in an HTTP stream, they might be misinterpreted at the receiving end. HTML encoding converts characters that are not allowed in HTML into character-entity equivalents; HTML decoding reverses the encoding. For example, when embedded in a block of text, the characters < and > are encoded as < and > for HTTP transmission.
Converts a string that has been HTML-encoded into a decoded string, and sends the decoded string to a output stream.
The string to decode.
A stream of output.
Method
4.0.0.0
System.String
If characters such as blanks and punctuation are passed in an HTTP stream, they might be misinterpreted at the receiving end. HTML encoding converts characters that are not allowed in HTML into character-entity equivalents; HTML decoding reverses the encoding. For example, when embedded in a block of text, the characters < and > are encoded as < and > for HTTP transmission.
If the parameter is null, then the returned encoded string is null. If the parameter is an empty string, then the returned encoded string is an empty string.
Converts a string to an HTML-encoded string.
An encoded string.
The string to encode.
Method
4.0.0.0
System.Void
If characters such as blanks and punctuation are passed in an HTTP stream, they might be misinterpreted at the receiving end. HTML encoding converts characters that are not allowed in HTML into character-entity equivalents; HTML decoding reverses the encoding. For example, when embedded in a block of text, the characters < and >, are encoded as < and > for HTTP transmission.
Converts a string into an HTML-encoded string, and returns the output as a stream of output.
The string to encode.
A output stream.
Method
4.0.0.0
System.String
If characters such as blanks and punctuation are passed in an HTTP stream, they might be misinterpreted at the receiving end. URL encoding converts characters that are not allowed in a URL into equivalent hexadecimal escape sequences. The method creates a URL-encoded string.
URL decoding replaces hexadecimal escape sequences with corresponding ASCII character equivalents. For example, when embedded in a block of URL-encoded text, the escape sequences %3c and %3e are decoded into the characters < and >.
Converts a string that has been encoded for transmission in a URL into a decoded string.
Returns .
A decoded string.
A URL-encoded string to decode.
Method
4.0.0.0
System.Byte[]
If characters such as blanks and punctuation are passed in an HTTP stream, they might be misinterpreted at the receiving end. URL encoding converts characters that are not allowed in a URL into equivalent hexadecimal escape sequences. The method creates a URL-encoded byte array.
URL decoding replaces hexadecimal escape sequences with corresponding ASCII character equivalents. For example, when embedded in a block of URL-encoded text, the escape sequences %3c and %3e are decoded into the characters < and >.
Converts an encoded byte array that has been encoded for transmission in a URL into a decoded byte array.
Returns .
A decoded array.
A URL-encoded array to decode.
The offset, in bytes, from the start of the array to decode.
The count, in bytes, to decode from the array.
Method
4.0.0.0
System.String
If characters such as blanks and punctuation are passed in an HTTP stream, they might be misinterpreted at the receiving end. URL encoding replaces characters that are not allowed in a URL with character-entity equivalents consisting of hexadecimal escape sequences. The converted string is expected to conform to the UTF-8 format.
URL encoding replaces all character codes except for letters, numbers, and the following punctuation characters:
-
- (minus sign)
-
_ (underscore)
-
. (period)
-
! (exclamation point)
-
* (asterisk)
-
' (single quotation mark)
-
( and ) (opening and closing parentheses)
For example, when embedded in a block of text to be transmitted in a URL, the characters < and > are encoded as %3c and %3e.
The method reverses the encoding.
Converts a text string into a URL-encoded string.
Returns .
A URL-encoded string.
The text to URL-encode.
Method
4.0.0.0
System.Byte[]
If characters such as blanks and punctuation are passed in an HTTP stream, they might be misinterpreted at the receiving end. URL encoding replaces characters that are not allowed in a URL with character-entity equivalents consisting of hexadecimal escape sequences. The converted string is expected to conform to the UTF-8 format.
URL encoding replaces all character codes except for letters, numbers, and the following punctuation characters:
-
- (minus sign)
-
_ (underscore)
-
. (period)
-
! (exclamation point)
-
* (asterisk)
-
' (single quotation mark)
-
( and ) (opening and closing parentheses)
For example, when embedded in a block of text to be transmitted in a URL, the characters < and > are encoded as %3c and %3e.
The method reverses the encoding.
Converts a byte array into a URL-encoded byte array.
Returns .
An encoded array.
The array to URL-encode.
The offset, in bytes, from the start of the array to encode.
The count, in bytes, to encode from the array.