Marek Lewczuk wrote:For sure it is not a problem with responseText - I can display (e.g. with alert()) utf characters from responseText.
I guess the issue then is not with responseText but how you write that
is not really suitable to allow a script to write anything outside of ASCII to a file I think.
How do you try to write to a file?
var file = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);
file.initWithPath("c:\file.txt");
file.create(file.NORMAL_FILE_TYPE, 0644);
var ioService = Components.classes["@mozilla.org/network/io-service;1"].getService(Components.interfaces.nsIIOService);
var uri = ioService.newFileURI(file);
var channel = ioService.newChannelFromURI(uri);
var outputStream = Components.classes["@mozilla.org/network/file-output-stream;1"].createInstance(Components.interfaces.nsIFileOutputStream);
outputStream.init(file, 0x20|0x02, 00004, null); var buffer = request.responseText;
outputStream.write(buffer, buffer.length); outputStream.flush(); outputStream.close(); _______________________________________________ Mozilla-xpcom mailing list [email protected] http://mail.mozilla.org/listinfo/mozilla-xpcom
