blob: 51ee95f7ea5b5ba449a05564025b722fdc0969b7 [file] [log] [blame]
<meta charset=windows-1251>
<body>
<p>Test how non-ASCII characters are encoded in relative URLs.</p>
<a href="?çàïðîñ">1</a>
<a href="#ôðàãìåíò">2</a>
<a href="ïóòü">3</a>
<a href="/ïóòü">4</a>
<a href="/ïóòü?çàïðîñ#ôðàãìåíò">5</a>
<pre id=result></pre>
<script>
if (window.testRunner)
testRunner.dumpAsText();
function log(message)
{
document.getElementById("result").innerHTML += message + "\n";
}
// Everything except for query (search) part is encoded as UTF-8 in Firefox.
log("1. " + (document.getElementsByTagName("a")[0].href.match(/%E7%E0%EF%F0%EE%F1$/) ? "PASS" : "FAIL: " + document.getElementsByTagName("a")[0].href));
log("2. " + (document.getElementsByTagName("a")[1].href.match(/#%D1%84%D1%80%D0%B0%D0%B3%D0%BC%D0%B5%D0%BD%D1%82$/) ? "PASS" : "FAIL: " + document.getElementsByTagName("a")[1].href));
log("3. " + (document.getElementsByTagName("a")[2].href.match(/%D0%BF%D1%83%D1%82%D1%8C$/) ? "PASS" : "FAIL: " + document.getElementsByTagName("a")[2].href));
log("4. " + (document.getElementsByTagName("a")[3].href.match(/%D0%BF%D1%83%D1%82%D1%8C$/) ? "PASS" : "FAIL: " + document.getElementsByTagName("a")[3].href));
log("5. " + (document.getElementsByTagName("a")[4].href.match(/%D0%BF%D1%83%D1%82%D1%8C\?%E7%E0%EF%F0%EE%F1#%D1%84%D1%80%D0%B0%D0%B3%D0%BC%D0%B5%D0%BD%D1%82$/) ? "PASS" : "FAIL: " + document.getElementsByTagName("a")[4].href));
</script>
</body>