// It is necessary to manually disable `xpc::IsInAutomation` since // `resetPrefs` will flip the preference to re-enable `once`-synced // preference change assertions, and also change the value of those // preferences.
Services.prefs.setBoolPref( "security.turn_off_all_security_so_that_viruses_can_take_over_this_computer", false
);
// This one is ASCII, so we can use getCharPref() and getStringPref // interchangeably. Assert.equal(
ps.getCharPref("string.x-escapes1"), "Mozilla0\x4d\x6F\x7a\x69\x6c\x6C\x610"
); Assert.equal(ps.getStringPref("string.x-escapes1"), "Mozilla0Mozilla0");
// This one has chars with value > 127, so it's not valid UTF8, so we can't // use getStringPref on it. Assert.equal(
ps.getCharPref("string.x-escapes2"), "AA A_umlaut\xc4 y_umlaut\xff"
);
// The following strings use \uNNNN escapes, which are UTF16 code points. // libpref stores them internally as UTF8 byte sequences. In each case we get // the string in two ways: // - getStringPref() interprets it as UTF8, which is then converted to UTF16 // in JS. I.e. code points that are multiple bytes in UTF8 become a single // 16-bit char in JS (except for the non-BMP chars, which become a 16-bit // surrogate pair). // - getCharPref() interprets it as Latin1, which is then converted to UTF16 // in JS. I.e. code points that are multiple bytes in UTF8 become multiple // 16-bit chars in JS.
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.