rem: aStream.write(str, str.length); 
add:    var convStream = Components.classes["@mozilla.org/intl/converter-output-stream;1"] .getService(Components.interfaces.nsIConverterOutputStream); convStream.init(aStream, 'UTF-8', 0, 0x0000);  convStream.writeString(str); convStream.close();  
context: function ics_exportToStream(aStream, aCount, aItems) {    icssrv = Components.classes["@mozilla.org/calendar/ics-service;1"]                       .getService(Components.interfaces.calIICSService);    var calComp = icssrv.createIcalComponent("VCALENDAR");    calComp.version = "2.0";    calComp.prodid = "-//Mozilla.org/NONSGML Mozilla Calendar V1.0//EN";        for each (item in aItems) {        calComp.addSubcomponent(item.icalComponent);    }    var str = calComp.serializeToICS();    aStream.write(str, str.length);    return;};
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/5be32f4ac6e86923606246ea51a7347e15366191/calIcsImportExport.js/buggy/calendar/import-export/calIcsImportExport.js