Permalink
Browse files

Merge pull request #8 from dindog/master

  • Loading branch information...
supahgreg committed Aug 25, 2012
2 parents ff19024 + e32b6f4 commit 8ed48d7a039d584ba2219be07c74e67c7b34725c
Showing with 6 additions and 2 deletions.
  1. +4 −2 extension/content/js/newscript.js
  2. +2 −0 extension/modules/constants.js
@@ -87,8 +87,10 @@ function doInstall() {
// put this created script into a file -- only way to install it
var tempFile = Scriptish_getTempFile();
var foStream = Scriptish_getWriteStream(tempFile);
- foStream.write(script, script.length);
- foStream.close();
+ var converter = Instances.cos;
+ converter.init(foStream, "UTF-8", 0, 0);
+ converter.writeString(script);
+ converter.close(); // this closes foStream
// create a script object with parsed metadata,
script = Scriptish_config.parse(script);
@@ -38,6 +38,8 @@ var Instances = {
.createInstance(Ci.nsISupportsString),
get suc() Cc["@mozilla.org/intl/scriptableunicodeconverter"]
.createInstance(Ci.nsIScriptableUnicodeConverter),
+ get cos() Cc["@mozilla.org/intl/converter-output-stream;1"]
+ .createInstance(Ci.nsIConverterOutputStream),
get timer() Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer),
get wbp() Cc["@mozilla.org/embedding/browser/nsWebBrowserPersist;1"]
.createInstance(Ci.nsIWebBrowserPersist),

0 comments on commit 8ed48d7

Please sign in to comment.