Currently I'm using an instance of nsIBinaryOutputStream and calling
write(msg, msg.length) to send the string through the socket.
I have been unable to setup a nsIConverterOutputStream, or pretty much
any of the localization interfaces properly to handle the conversion
to UTF-8.
Any help on this would be greatly appreciated.
nsIBinaryOutputStream::writeUtf8Z sounds like what you'd want (assuming
no embedded null bytes). You're calling nsIOutputStream::write(string,
unsigned long) (which nsIBinaryOutputStream inherits), and that takes
(non-Unicode) chars. If you're JavaScript, that means that xpconnect
needs to lossily convert your Unicode strings.
You can also try using nsIScriptableUnicodeConverter to convert your
Unicode (UTF16, actually) strings to UTF8.
(follow-up set to m.d.extensions)
HTH,
--
Mook
mook dot moz plus stuff at gmail yadayada