success = false;
break;
}
+
+ if (success && host.Length > 1 && host [0] != '[' && host [host.Length - 1] != ']') {
+ // host name present (but not an IPv6 address)
+ host = host.ToLower (CultureInfo.InvariantCulture);
+ }
}
}
{
Parse (kind, source);
- if (userEscaped)
- return;
-
if (host.Length > 1 && host [0] != '[' && host [host.Length - 1] != ']') {
// host name present (but not an IPv6 address)
host = host.ToLower (CultureInfo.InvariantCulture);
Assert.IsTrue (Uri.TryCreate ("http://mono-project.com/☕", UriKind.Absolute, out uri), "highunicode-Absolute");
Assert.AreEqual("http://mono-project.com/%E2%98%95", uri.AbsoluteUri, "highunicode-Absolute-AbsoluteUri");
+
+ string mixedCaseUri = "http://mOnO-proJECT.com";
+ uri = new Uri (mixedCaseUri);
+ Uri uri2;
+ Assert.IsTrue (Uri.TryCreate (mixedCaseUri, UriKind.Absolute, out uri2), "mixedcasehost-absolute");
+ Assert.AreEqual (uri.AbsoluteUri, uri2.AbsoluteUri, "mixedcasehost-absoluteuri-absoluteuri");
}
[Test] // TryCreate (String, UriKind, Uri)