Debug.Assert((_flags & Flags.HasUserInfo) == 0 && (_flags & Flags.HostTypeMask) == 0);
+ // need to build new Iri'zed string
+ if (hostNotUnicodeNormalized)
+ {
+ newHost = _originalUnicodeString.Substring(0, startInput);
+ }
+
//Special case is an empty authority
if (idx == length || ((ch = pString[idx]) == '/' || (ch == '\\' && StaticIsFile(syntax)) || ch == '#' || ch == '?'))
{
return idx;
}
- // need to build new Iri'zed string
- if (hostNotUnicodeNormalized)
- {
- newHost = _originalUnicodeString.Substring(0, startInput);
- }
-
string? userInfoString = null;
// Attempt to parse user info first
Assert.False(timedOut);
}
+ [Fact]
+ public static void UriWithUnicodeAndEmptyAuthority_ParsedCorrectly()
+ {
+ const string UriString = "custom:///\u00FC";
+ Assert.Equal(UriString, new Uri(UriString, UriKind.Absolute).ToString());
+ }
+
public static IEnumerable<object[]> FilePathHandlesNonAscii_TestData()
{
if (PlatformDetection.IsNotWindows)