rem: try { prefs = Components.classes['component: prefs = prefs.getService(); prefs = prefs.QueryInterface(Components.interfaces.nsIPref); 
add: var charset = msgCompose.compFields.GetCharacterSet(); if (g_send_default_charset == null) { try { prefs = Components.classes['component: prefs = prefs.getService(); prefs = prefs.QueryInterface(Components.interfaces.nsIPref); g_send_default_charset = prefs.CopyCharPref("mailnews.send_default_charset"); } catch (ex) { dump("failed to get prefs service!\n"); prefs = null; g_send_default_charset = charset; } 
context: function GetCharsetUIString(){  try {    prefs = Components.classes['component://netscape/preferences'];    prefs = prefs.getService();    prefs = prefs.QueryInterface(Components.interfaces.nsIPref);  }  catch (ex) {    dump("failed to get prefs service!\n");    prefs = null;  }  var send_default_charset = prefs.CopyCharPref("mailnews.send_default_charset");  var charset = msgCompose.compFields.GetCharacterSet();  charset = charset.toUpperCase();  if (charset == "US-ASCII")    charset = "ISO-8859-1";  if (charset != send_default_charset) {    var charsetTitle = "";    try {      var ccm = Components.classes['component://netscape/charset-converter-manager'];      ccm = ccm.getService();      ccm = ccm.QueryInterface(Components.interfaces.nsICharsetConverterManager2);    }    catch (ex) {      dump("failed to get charset-converter-manager service!\n");      ccm = null;    }    // get a localized string    try {      var charsetAtom = ccm.GetCharsetAtom(charset);      charsetTitle = ccm.GetCharsetTitle(charsetAtom);    }    catch (ex) {      dump("failed to get a charset title of " + charset + "!\n");      charsetTitle = "";    }    return " - " + charsetTitle;  }  return "";}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/4ac194e9142418a8988d6d8743f29f44e385333a/MsgComposeCommands.js/buggy/mailnews/compose/resources/content/MsgComposeCommands.js