IPv6Host = 1 << 5,
NoSlashReplace = 1 << 6,
NoReduce = 1 << 7,
+ HasWindowsPath = 1 << 8,
}
[Flags]
str.Length > 1 && str [0] == '[' && str [str.Length - 1] == ']')
formatFlags |= UriHelper.FormatFlags.IPv6Host;
+ if (component == UriComponents.Path &&
+ str.Length >= 2 && str [1] != ':' &&
+ ('a' <= str [0] && str [0] <= 'z') || ('A' <= str [0] && str [0] <= 'Z'))
+ formatFlags |= UriHelper.FormatFlags.HasWindowsPath;
+
UriSchemes scheme = GetScheme (schemeName);
if (scheme == UriSchemes.Custom && (formatFlags & FormatFlags.HasHost) != 0)
if (SchemeContains (scheme, UriSchemes.NetPipe | UriSchemes.NetTcp | UriSchemes.File))
return "/";
+
+ if (SchemeContains (scheme, UriSchemes.Custom) &&
+ (formatFlags & FormatFlags.HasWindowsPath) == 0)
+ return "/";
}
var ret = c.ToString (CultureInfo.InvariantCulture);