mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 23:31:56 +00:00
Bug 494217 - nsINetUtil::unescapeString drops high bytes of UTF-16 strings from JS
This fixes an issue where unescapeString will drop the high bytes of a UTF-16 string when unescaping, resulting in a loss of data. r=bz sr=bz
This commit is contained in:
parent
e25711d0bd
commit
6a8d60b403
@ -46,7 +46,7 @@ interface nsIPrefBranch;
|
||||
/**
|
||||
* nsINetUtil provides various network-related utility methods.
|
||||
*/
|
||||
[scriptable, uuid(57322c6f-f4ec-4e46-8253-b74be220de16)]
|
||||
[scriptable, uuid(a50d5516-5c0a-4f08-b427-703ca0c44ac3)]
|
||||
interface nsINetUtil : nsISupports
|
||||
{
|
||||
/**
|
||||
@ -192,7 +192,7 @@ interface nsINetUtil : nsISupports
|
||||
* unescaped
|
||||
* @return unescaped string
|
||||
*/
|
||||
ACString unescapeString(in ACString aStr, in unsigned long aFlags);
|
||||
ACString unescapeString(in AUTF8String aStr, in unsigned long aFlags);
|
||||
|
||||
/**
|
||||
* Extract the charset parameter location and value from a content-type
|
||||
|
@ -13,7 +13,9 @@ var tests = [
|
||||
["foo%ffbar", "foo\xffbar", 0],
|
||||
["%00%1b%20%61%7f%80%ff", "%00%1b%20%61%7f\x80\xff", ONLY_NONASCII],
|
||||
["%00%1b%20%61%7f%80%ff", "%00%1b a%7f\x80\xff", SKIP_CONTROL],
|
||||
["%00%1b%20%61%7f%80%ff", "%00%1b%20%61%7f\x80\xff", ONLY_NONASCII|SKIP_CONTROL]
|
||||
["%00%1b%20%61%7f%80%ff", "%00%1b%20%61%7f\x80\xff", ONLY_NONASCII|SKIP_CONTROL],
|
||||
// Test that we do not drop the high-bytes of a UTF-16 string.
|
||||
["\u30a8\u30c9", "\xe3\x82\xa8\xe3\x83\x89", 0],
|
||||
];
|
||||
|
||||
function run_test() {
|
||||
|
Loading…
Reference in New Issue
Block a user