michael@0: /* Any copyright is dedicated to the Public Domain. michael@0: * http://creativecommons.org/publicdomain/zero/1.0/ michael@0: */ michael@0: michael@0: /* If charset parameter is invalid, the encoding should be detected as UTF-8 */ michael@0: michael@0: function run_test() michael@0: { michael@0: let body = '%c3%80'; michael@0: let result = '\u00c0'; michael@0: michael@0: let xhr = Components.classes['@mozilla.org/xmlextras/xmlhttprequest;1']. michael@0: createInstance(Components.interfaces.nsIXMLHttpRequest); michael@0: xhr.open('GET', michael@0: 'data:text/xml;charset=abc,' + body, michael@0: false); michael@0: xhr.send(null); michael@0: michael@0: do_check_eq(xhr.responseText, result); michael@0: }