| <title>Bug 133678: TextCodecICU::encode turns the whole string as yen signs if there is any backslash in it</title> |
| <p>Bug 133678: TextCodecICU::encode turns the whole string as yen signs if there is any backslash in it</p> |
| <form id="form" method="GET" target="iframe"> |
| <input type="text" id="text" name="text"></input> |
| <iframe id="iframe" name="iframe"></iframe> |
| var toBeEncoded = "abcde\\abcde"; |
| var expectedEncoded = "abcde%5Cabcde"; |
| testRunner.waitUntilDone(); |
| document.getElementById("log").innerHTML += msg + "<br>"; |
| var form = document.getElementById('form'); |
| var iframe = document.getElementById('iframe'); |
| function processEncodedString() { |
| var url = iframe.contentWindow.location.search; |
| encoded = url.substr(url.indexOf('=') + 1); |
| log(encoded == expectedEncoded ? "PASS": "FAILED: encoded string was '" + encoded + "' while expecting '" + expectedEncoded + "'"); |
| form.acceptCharset = charset; |
| form.action = "resources/dummy.html"; |
| document.getElementById('text').value = toBeEncoded; |
| iframe.onload = processEncodedString; |