]> rhodes.io Git - swankr.git/commitdiff
Christophe Weblog Wiki Code Publications Music
give us a chance with utf-8
authorChristophe Rhodes <csr21@cantab.net>
Fri, 9 Dec 2011 18:20:04 +0000 (18:20 +0000)
committerChristophe Rhodes <csr21@cantab.net>
Fri, 9 Dec 2011 18:20:04 +0000 (18:20 +0000)
Calculate the length of the output to emacs using nchar(type="bytes")

This makes help files sort-of work again

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)
 }