rem: shortcutURL = /%[sS]/.test(shortcutURL) ? shortcutURL.replace(/%s/g, encodeURIComponent(text)) .replace(/%S/g, text) : null; 
add: var encodedText = null; var charset = ""; const re = /^(.*)\&mozcharset=([a-zA-Z][_\-a-zA-Z0-9]+)\s*$/; var matches = shortcutURL.match(re); if (matches) { shortcutURL = matches[1]; charset = matches[2]; } else if (/%s/.test(shortcutURL)) { try { charset = BMSVC.getLastCharset(shortcutURL); } catch (ex) { } }  if (charset) encodedText = escape(convertFromUnicode(charset, text)); else encodedText = encodeURIComponent(text);  if (encodedText && /%[sS]/.test(shortcutURL)) shortcutURL = shortcutURL.replace(/%s/g, encodedText) .replace(/%S/g, text); else shortcutURL = null; 
context: function getShortcutOrURI(url){  // rjc: added support for URL shortcuts (3/30/1999)  try {    if (!gBookmarksService)      gBookmarksService = Components.classes["@mozilla.org/browser/bookmarks-service;1"]                                    .getService(Components.interfaces.nsIBookmarksService);    var shortcutURL = gBookmarksService.resolveKeyword(url);    if (!shortcutURL) {      // rjc: add support for string substitution with shortcuts (4/4/2000)      //      (see bug # 29871 for details)      var aOffset = url.indexOf(" ");      if (aOffset > 0) {        var cmd = url.substr(0, aOffset);        var text = url.substr(aOffset+1);        shortcutURL = gBookmarksService.resolveKeyword(cmd);        // Bug 123006 : %s replace and URI escape, %S replace with raw value        if (shortcutURL && text) {          shortcutURL = /%[sS]/.test(shortcutURL) ?              shortcutURL.replace(/%s/g, encodeURIComponent(text))                         .replace(/%S/g, text) :              null;        }      }    }    if (shortcutURL)      url = shortcutURL;  } catch (ex) {  }  return url;}
meta: 8395	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/8395/31e46a5d354d5010b5e5e15a2193c7b265836c4a/navigator.js/buggy/suite/browser/navigator.js