rem: saveDataToFile(filePath, aDataStream); 
add: saveDataToFile( filePath, aDataStream, charset ); 
context: function saveEventsToFile( calendarEventArray ){   if( !calendarEventArray)      calendarEventArray = gCalendarWindow.EventSelection.selectedEvents;   if (calendarEventArray.length == 0)   {      alert("No events selected to save");      return;   }   // No show the 'Save As' dialog and ask for a filename to save to   const nsIFilePicker = Components.interfaces.nsIFilePicker;   var fp = Components.classes["@mozilla.org/filepicker;1"].createInstance(nsIFilePicker);   // caller can force disable of sand box, even if ON globally   fp.init(window, "Save As", nsIFilePicker.modeSave);   if(calendarEventArray.length == 1 && calendarEventArray[0].title)      fp.defaultString = calendarEventArray[0].title;   else      fp.defaultString = "Mozilla Calendar events";   fp.defaultExtension = "ics";   fp.appendFilter( filterCalendar, "*" + extensionCalendar );   fp.appendFilter( filterRtf, "*" + extensionRtf );   fp.appendFilters(nsIFilePicker.filterHTML);   fp.appendFilter( filterCsv, "*" + extensionCsv );   fp.appendFilter( filterXcs, "*" + extensionXcs );   fp.appendFilter( filterRdf, "*" + extensionRdf );   fp.show();   // Now find out as what to save, convert the events and save to file.   if (fp.file && fp.file.path.length > 0)    {      var aDataStream;      var extension;      switch (fp.filterIndex) {      case 0 : // ics         aDataStream = eventArrayToICalString( calendarEventArray, true );         extension   = extensionCalendar;         break;      case 1 : // rtf         aDataStream = eventArrayToRTF( calendarEventArray );         extension   = extensionRtf;         break;      case 2 : // html         aDataStream = eventArrayToHTML( calendarEventArray );         extension   = ".htm";         break;      case 3 : // csv         aDataStream = eventArrayToCsv( calendarEventArray );         extension   = extensionCsv;         break;      case 4 : // xCal         aDataStream = eventArrayToXCS( calendarEventArray );         extension   = extensionXcs;         break;      case 5 : // rdf         aDataStream = eventArrayToRdf( calendarEventArray );         extension   = extensionRdf;         break;      }      var filePath = fp.file.path;      if(filePath.indexOf(".") == -1 )          filePath += extension;      saveDataToFile(filePath, aDataStream);   }}
meta: 10234	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/10234/70dd64cc23f19f07b46d7c846d4050fc37f7ca1f/importExport.js/clean/calendar/resources/content/importExport.js