Bug 691690 - Part 2: Use UTF-8 flag on copy. r=gavin

This commit is contained in:
Masatoshi Kimura 2011-10-07 07:35:17 +09:00
parent d6147c4165
commit cf20256c8d
2 changed files with 15 additions and 1 deletions

View File

@ -90,6 +90,20 @@ var tests = [
copyExpected: "http://example.com/\xe9"
},
{
loadURL: "http://example.com/?%C3%B7%C3%B7",
expectedURL: "example.com/?\xf7\xf7",
copyExpected: "http://example.com/?%C3%B7%C3%B7"
},
{
copyVal: "e<xample.com/?\xf7>\xf7",
copyExpected: "xample.com/?\xf7"
},
{
copyVal: "<example.com/?\xf7>\xf7",
copyExpected: "http://example.com/?\xf7"
},
// data: and javsacript: URIs shouldn't be encoded
{
loadURL: "javascript:('%C3%A9')",

View File

@ -515,7 +515,7 @@
let uri;
try {
uri = uriFixup.createFixupURI(inputVal, Ci.nsIURIFixup.FIXUP_FLAG_NONE);
uri = uriFixup.createFixupURI(inputVal, Ci.nsIURIFixup.FIXUP_FLAG_USE_UTF8);
} catch (e) {}
if (!uri)
return selectedVal;