[slime-devel] clisp without unicode patch

Helmut Eller heller at common-lisp.net
Thu Jan 19 22:53:03 UTC 2006

* Hoehle, Joerg-Cyril [2006-01-17 14:24+0100] writes:

> Hi,
> I thought about alternatives and rejected them. Probably this patch
> is just fine as is and it should not raise an error when Emacs uses
> UTF-8 or anything and clisp was only built with 8bit strings
> --without-unicode.

Hmm.. Emacs shouldn't use utf-8 if CLISP can't handle it.  If Emacs
encodes a string which includes non-ascii chars with utf-8 and, say,
CLISP tries to decode it with iso-8859-1, it will lead to errors
pretty quickly (because the packet length field isn't interpreted
correctly and the payload of the packet will be truncated).

The user has to choose an encoding that actually works and it's better
if we detect bad combinations as early as possible than to proceed as
long as possible, because at that point we can no longer print
reasonable error messages.

It would be nice if SLIME could ask CLISP what encodings are available
and than switch to one of those.  But that doesn't work in practice
because not all Lisp implementations can switch the encoding of
streams on the fly.  (Closing and re-opening the connection with a
different encoding sounds like a terrible solution too.)

> 2006-01-14  Joerg Hoehle <hoehle at users.sourceforge.net>
> 	* swank-clisp (find-encoding): work in a 8bit clisp w/o #-UNICODE.
> --- swank-clisp.lisp.orig	2005-11-12 00:43:43.000000000 +0100
> +++ swank-clisp.lisp	2006-01-14 13:17:08.000000000 +0100
> @@ -122,7 +122,9 @@
>  		   (:iso-latin-1-unix "iso-8859-1")
>  		   (:utf-8-unix       "utf-8")
>  		   (:euc-jp-unix      "euc-jp"))))
> -    (ext:make-encoding :charset charset :line-terminator :unix)))
> +    (ext:make-encoding :charset (if (member :unicode *features*)
> +				    charset :default)
> +		       :line-terminator :unix)))
>  (defimplementation accept-connection (socket
>  				      &key (external-format :iso-latin-1-unix)
> The idea in the present patch is that (untested) the same set of
> slime.fas files might possibly work in both builds of clisp: with
> and without unicode.  But you'd need to compile from the 8bit
> version.

Is "iso-8859-1" available in CLISPs --without-unicode ?  If it is,
then the unpatched fasl files should also work with both builds.  But
the user has to choose latin-1 on the Emacs side.


More information about the slime-devel mailing list