Christophe Weblog Wiki Code Publications Music
give us a chance with utf-8
[swankr.git] / swank.R
diff --git a/swank.R b/swank.R
index 24393e674d4d4acb54336d10adda46dd9789b788..dea28cf99f2f72cec6ccadc13d1266b88b571c78 100644 (file)
--- a/swank.R
+++ b/swank.R
@@ -62,7 +62,7 @@ dispatch <- function(slimeConnection, event, sldbState=NULL) {
 sendToEmacs <- function(slimeConnection, obj) {
   io <- slimeConnection$io
   payload <- writeSexpToString(obj)
-  writeChar(sprintf("%06x", nchar(payload)), io, eos=NULL)
+  writeChar(sprintf("%06x", nchar(payload, type="bytes")), io, eos=NULL)
   writeChar(payload, io, eos=NULL)
   flush(io)
 }