rem: var scriptableInputStream = Components.classes["@mozilla.org/scriptableinputstream;1"] .createInstance(Components.interfaces.nsIScriptableInputStream); scriptableInputStream.init(aStream); var str = scriptableInputStream.read(-1); 
add:   var convStream = Components.classes["@mozilla.org/intl/converter-input-stream;1"] .getService(Components.interfaces.nsIConverterInputStream); convStream.init(aStream, 'UTF-8', 0, 0x0000);  var str = {}; convStream.readString(-1, str); 
context: function ics_importFromStream(aStream, aCount) {    var items = new Array();    var scriptableInputStream = Components.classes["@mozilla.org/scriptableinputstream;1"]                                      .createInstance(Components.interfaces.nsIScriptableInputStream);    scriptableInputStream.init(aStream);    var str = scriptableInputStream.read(-1);    icssrv = Components.classes["@mozilla.org/calendar/ics-service;1"]                       .getService(Components.interfaces.calIICSService);    var calComp = icssrv.parseICS(str);    var subComp = calComp.getFirstSubcomponent("ANY");    while (subComp) {        switch (subComp.componentType) {        case "VEVENT":            var event = Components.classes["@mozilla.org/calendar/event;1"]                                  .createInstance(Components.interfaces.calIEvent);            event.icalComponent = subComp;            items.push(event);            break;        case "VTODO":            var todo = Components.classes["@mozilla.org/calendar/todo;1"]                                 .createInstance(Components.interfaces.calITodo);            todo.icalComponent = subComp;            items.push(todo);            break;        default:            // Nothing        }        subComp = calComp.getNextSubcomponent("ANY");    }    aCount.value = items.length;    return items;};
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/5be32f4ac6e86923606246ea51a7347e15366191/calIcsImportExport.js/buggy/calendar/import-export/calIcsImportExport.js