You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/fundamentals/runtime-libraries/system-uri.md
+8-16
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ ms.date: 12/31/2023
7
7
8
8
[!INCLUDE [context](includes/context.md)]
9
9
10
-
A URI is a compact representation of a resource available to your application on the intranet or internet. The <xref:System.Uri> class defines the properties and methods for handling URIs, including parsing, comparing, and combining. The <xref:System.Uri> class properties are read-only; to create a modifiable object, use the <xref:System.UriBuilder> class.
10
+
A uniform resource identifier (URI) is a compact representation of a resource available to your application on the intranet or internet. The <xref:System.Uri> class defines the properties and methods for handling URIs, including parsing, comparing, and combining. The <xref:System.Uri> class properties are read-only; to create a modifiable object, use the <xref:System.UriBuilder> class.
11
11
12
12
Relative URIs (for example, "/new/index.htm") must be expanded with respect to a base URI so that they are absolute. The <xref:System.Uri.MakeRelativeUri%2A> method is provided to convert absolute URIs to relative URIs when necessary.
13
13
@@ -16,24 +16,16 @@ The <xref:System.Uri> constructors do not escape URI strings if the string is a
16
16
The <xref:System.Uri> properties return a canonical data representation in escaped encoding, with all characters with Unicode values greater than 127 replaced with their hexadecimal equivalents. To put the URI in canonical form, the <xref:System.Uri> constructor performs the following steps:
17
17
18
18
- Converts the URI scheme to lowercase.
19
-
20
19
- Converts the host name to lowercase.
21
-
22
20
- If the host name is an IPv6 address, the canonical IPv6 address is used. ScopeId and other optional IPv6 data are removed.
23
-
24
21
- Removes default and empty port numbers.
25
-
26
22
- Converts implicit file paths without the file:// scheme (for example, "C:\my\file") to explicit file paths with the file:// scheme.
27
-
28
23
- Escaped characters (also known as percent-encoded octets) that don't have a reserved purpose are decoded (also known as being unescaped). These unreserved characters include uppercase and lowercase letters (%41-%5A and %61-%7A), decimal digits (%30-%39), hyphen (%2D), period (%2E), underscore (%5F), and tilde (%7E).
29
-
30
-
- Canonicalizes the path for hierarchical URIs by compacting sequences such as /./, /../, and // (whether or not the sequence is escaped). Note that there are some schemes for which these sequences are not compacted.
31
-
24
+
- Canonicalizes the path for hierarchical URIs by compacting sequences such as `/./` and `/../` (whether or not the sequence is escaped). Note that there are some schemes for which these sequences are not compacted.
32
25
- For hierarchical URIs, if the host is not terminated with a forward slash (/), one is added.
33
-
34
26
- By default, any reserved characters in the URI are escaped in accordance with RFC 2396. This behavior changes if International Resource Identifiers or International Domain Name parsing is enabled in which case reserved characters in the URI are escaped in accordance with RFC 3986 and RFC 3987.
35
27
36
-
As part of canonicalization in the constructor for some schemes, dot-segments and empty segments (`/./`, `/../`, and `//`) are compacted (in other words, they are removed). The schemes for which <xref:System.Uri> compacts segments include http, https, tcp, net.pipe, and net.tcp. For some other schemes, these sequences are not compacted. The following code snippet shows how compacting looks in practice. The escaped sequences are unescaped, if necessary, and then compacted.
28
+
As part of canonicalization in the constructor for some schemes, dot-segments (`/./` and `/../`) are compacted (in other words, they're removed). The schemes for which <xref:System.Uri> compacts segments include http, https, tcp, net.pipe, and net.tcp. For some other schemes, these sequences are not compacted. The following code snippet shows how compacting looks in practice. The escaped sequences are unescaped, if necessary, and then compacted.
@@ -64,7 +56,7 @@ Some URIs include a fragment identifier or a query or both. A fragment identifie
64
56
65
57
## International resource identifier support
66
58
67
-
Web addresses are typically expressed using uniform resource identifiers that consist of a very restricted set of characters:
59
+
Web addresses are typically expressed using URIs that consist of a very restricted set of characters:
68
60
69
61
- Upper and lower case ASCII letters from the English alphabet.
70
62
- Digits from 0 to 9.
@@ -92,15 +84,15 @@ There are three possible values for IDN depending on the DNS servers that are us
92
84
93
85
- idn enabled = All
94
86
95
-
This value will convert any Unicode domain names to their Punycode equivalents (IDN names).
87
+
Converts any Unicode domain names to their Punycode equivalents (IDN names).
96
88
97
89
- idn enabled = AllExceptIntranet
98
90
99
-
This value will convert all Unicode domain names not on the local Intranet to use the Punycode equivalents (IDN names). In this case to handle international names on the local Intranet, the DNS servers that are used for the Intranet should support Unicode name resolution.
91
+
Converts all Unicode domain names not on the local Intranet to use the Punycode equivalents (IDN names). In this case, to handle international names on the local Intranet, the DNS servers that are used for the Intranet should support Unicode name resolution.
100
92
101
93
- idn enabled = None
102
94
103
-
This value will not convert any Unicode domain names to use Punycode. This is the default value.
95
+
No Unicode domain names are converted to use Punycode. This is the default value.
104
96
105
97
Normalization and character checking are done according to the latest IRI rules in RFC 3986 and RFC 3987.
106
98
@@ -121,7 +113,7 @@ Uri uri1 = new Uri("C:/test/path/file.txt") // Implicit file path.
0 commit comments