Permalink
Browse files

change what is emitted to the socket to utf8

  • Loading branch information...
1 parent 531c609 commit 7d3c32d404722c5c4f05bc5df494769322944eb6 @notEthan notEthan committed with Apr 25, 2011
Showing with 4 additions and 1 deletion.
  1. +4 −1 chrome/content/server.js
View
@@ -96,6 +96,9 @@ function start(port, loopbackOnly) {
function onSocketAccepted(serv, transport) {
try {
var outstream = transport.openOutputStream(Ci.nsITransport.OPEN_BLOCKING , 0, 0);
+ var outstreamutf8 = Cc['@mozilla.org/intl/converter-output-stream;1']
+ .createInstance(Ci.nsIConverterOutputStream);
+ outstreamutf8.init(outstream, 'UTF-8', 0, 0);
var stream = transport.openInputStream(0, 0, 0);
var instream = Cc['@mozilla.org/intl/converter-input-stream;1']
@@ -118,7 +121,7 @@ function onSocketAccepted(serv, transport) {
var session = new REPL();
session.onOutput = function(string) {
- outstream.write(string, string.length);
+ outstreamutf8.writeString(string);
};
session.onQuit = function() {
log('I, MOZREPL : Client closed connection : ' + transport.host + ':' + transport.port);

0 comments on commit 7d3c32d

Please sign in to comment.