rem: if( typeof( result ) != "string" ) result = String.fromCharCode.apply(this, result); 
add: if( typeof( result ) != "string" ) {     var sliceStringArray = new Array(); for (var start = 0, end; start < (end = Math.min(result.length, start + 32768)); start = end) { var slice = result.slice(start, end); var sliceString = String.fromCharCode.apply(null, slice); sliceStringArray[sliceStringArray.length] = sliceString; } result = sliceStringArray.join(""); } 
context:       onStreamComplete: function(loader, ctxt, status, resultLength, result)      {         // revert from "wait" cursor set by getRemoteCalendarText (below)         window.setCursor( "auto" );         var calendarStringBundle = srGetStrBundle("chrome://calendar/locale/calendar.properties");         var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]                                       .getService(Components.interfaces.nsIPromptService);         var retval = false;         if( typeof( result ) != "string" ) //for 1.7 compatibility             result = String.fromCharCode.apply(this, result);         var ch;         try {           ch = loader.request.QueryInterface(Components.interfaces.nsIHttpChannel);         } catch(e) {         }         if (ch && !ch.requestSucceeded) {           promptService.alert(null, calendarStringBundle.GetStringFromName('errorTitle'),                               calendarStringBundle.formatStringFromName('httpError',[ch.responseStatus, ch.responseStatusText],2));         }         else if (ch && !Components.isSuccessCode(loader.request.status)) {           // XXX this should be made human-readable.           promptService.alert(null, calendarStringBundle.GetStringFromName('errorTitle'),                               calendarStringBundle.formatStringFromName('otherError',[loader.request.status.toString(16)],1));         }         //check to make sure its actually a calendar file, if not return.         else if( result.indexOf( "BEGIN:VCALENDAR" ) == -1 )         {           promptService.alert(null, calendarStringBundle.GetStringFromName('errorTitle'),                               calendarStringBundle.formatStringFromName('contentError',[Channel.URI.spec, result],2));         } else {             onResponse( result );             retval = true;         }         if( gNextSubNodeToRefresh )            gCalendarWindow.calendarManager.refreshAllRemoteCalendars();         return retval;      }
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/030ebe294998c7e1fc5c8548809521f608988c54/calendarManager.js/clean/calendar/resources/content/calendarManager.js