Skip to content

Commit 9e9e2e0

Browse files
authored
Clarify casing of escape characters for encoding (#8018)
WebUtility.UrlEncode(String) Method encodes with upper case characters, unlike HttpUtility.UrlEncode. The difference will cause string comparisons of encoded values to fail, so as for a dictionary key lookup.
1 parent bc8bafa commit 9e9e2e0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

xml/System.Net/WebUtility.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@
365365
<format type="text/markdown"><![CDATA[
366366
367367
## Remarks
368-
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 <xref:System.Net.WebUtility.UrlEncode%2A> method creates a URL-encoded string.
368+
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 hexadecimal escape sequences are in uppercase. For example, the characters `<` and `>` are encoded into the escape sequences `%3C` and `%3E`. The <xref:System.Net.WebUtility.UrlEncode%2A> method creates a URL-encoded string.
369369
370370
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 `>`.
371371

0 commit comments

Comments
 (0)