yield return Tuple.Create("%1g", "%1g");
yield return Tuple.Create("%G1", "%G1");
yield return Tuple.Create("%1G", "%1G");
+
+ // The "Baz" portion of "http://example.net/Baz" has been double-encoded - one iteration of UrlDecode() should produce a once-encoded string.
+ yield return Tuple.Create("http://example.net/%2542%2561%257A", "http://example.net/%42%61%7A");
+ // The second iteration should return the original string
+ yield return Tuple.Create("http://example.net/%42%61%7A", "http://example.net/Baz");
}
public static IEnumerable<Tuple<string, string>> UrlEncode_SharedTestData()
new object[] { "http://example.net/\uFFFD", "http://example.net/\uD800" },
new object[] { "http://example.net/\uFFFDa", "http://example.net/\uD800a" },
new object[] { "http://example.net/\uFFFD", "http://example.net/\uDC00" },
- new object[] { "http://example.net/\uFFFDa", "http://example.net/\uDC00a" }
+ new object[] { "http://example.net/\uFFFDa", "http://example.net/\uDC00a" },
+ // The "Baz" portion of "http://example.net/Baz" has been double-encoded - one iteration of UrlDecode() should produce a once-encoded string.
+ new object[] { "http://example.net/%42%61%7A", "http://example.net/%2542%2561%257A"},
+ // The second iteration should return the original string
+ new object[] { "http://example.net/Baz", "http://example.net/%42%61%7A"}
};
public static IEnumerable<object[]> UrlDecodeDataToBytes =>