rem: var convStream = Components.classes["@mozilla.org/intl/converter-input-stream;1"] .getService(Components.interfaces.nsIConverterInputStream); convStream.init(aStream, 'UTF-8', 0, 0x0000); 
add: var unicodeConverter = Components.classes["@mozilla.org/intl/scriptableunicodeconverter"] .createInstance(Components.interfaces.nsIScriptableUnicodeConverter);  unicodeConverter.charset = "UTF-8"; var str = unicodeConverter.ConvertFromUnicode(octetArray); 
context: function ics_importFromStream(aStream, aCount) {    var items = new Array();    // Interpret the byte-array as an utf8 string, and convert into a    // javascript string.    var convStream = Components.classes["@mozilla.org/intl/converter-input-stream;1"]                               .getService(Components.interfaces.nsIConverterInputStream);    convStream.init(aStream, 'UTF-8', 0, 0x0000);    var tmpStr = {};    var str = "";    while (convStream.readString(-1, tmpStr)) {        str += tmpStr.value;    }    icssrv = Components.classes["@mozilla.org/calendar/ics-service;1"]                       .getService(Components.interfaces.calIICSService);    var rootComp = icssrv.parseICS(str);    var calComp;    // libical returns the vcalendar component if there is just    // one vcalendar. If there are multiple vcalendars, it returns    // an xroot component, with those vcalendar childs. We need to    // handle both.    if (rootComp.componentType == 'VCALENDAR') {        calComp = rootComp;    } else {        calComp = rootComp.getFirstSubcomponent('VCALENDAR');    }    while (calComp) {        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");        }        calComp = rootComp.getNextSubcomponent('VCALENDAR');    }    aCount.value = items.length;    return items;};
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/d0450153cb3b87748bead76205d1e958d942202f/calIcsImportExport.js/buggy/calendar/import-export/calIcsImportExport.js