rem: fos.write(str, str.length); 
add: cos.writeString(str); cos.close(); 
context: function CCKWriteDTD(destdir){  var file = destdir.clone();  file.append("cck.dtd");  try {    file.remove(false);                           } catch (ex) {}  var fos = Components.classes["@mozilla.org/network/file-output-stream;1"]                      .createInstance(Components.interfaces.nsIFileOutputStream);  fos.init(file, -1, -1, false);    var ioService=Components.classes["@mozilla.org/network/io-service;1"]                          .getService(Components.interfaces.nsIIOService);  var scriptableStream=Components.classes["@mozilla.org/scriptableinputstream;1"]                                 .getService(Components.interfaces.nsIScriptableInputStream);      var channel=ioService.newChannel("chrome://cckwizard/content/srcfiles/cck.dtd.in",null,null);  var input=channel.open();  scriptableStream.init(input);  var str=scriptableStream.read(input.available());  scriptableStream.close();  input.close();  str = str.replace(/%throbber.tooltip%/g, document.getElementById("AnimatedLogoTooltip").value);  str = str.replace(/%mainWindow.titlemodifier%/g, document.getElementById("CompanyName").value);  str = str.replace(/%cckHelp.label%/g, document.getElementById("HelpMenuCommandName").value);  str = str.replace(/%cckHelp.accesskey%/g, document.getElementById("HelpMenuCommandAccesskey").value);  fos.write(str, str.length);   fos.close();}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/073feb31a87d826a9d7c3504a1a6a9708c9f7465/cckwizard.js/buggy/extensions/cck/browser/resources/content/cckwizard/cckwizard.js