[slime-devel] Re: charset problem with clisp

Alex Mizrahi killerstorm at newmail.ru
Mon May 3 14:51:36 UTC 2004


(message (Hello 'Helmut)
(you :wrote  :on '(Sun, 02 May 2004 21:51:56 +0200))
(

 >> i don't know - maybe it's a bug in clisp and has nothing to do with
 >> slime..
 >> i cannot understand what happens - i thought that they communicate
 >> with plain octet-stream and only interpretation of some values got
 >> changed..

 HE> I'm sorry, but I don't know how to deal with charset problems.
 HE> Heck,
 HE> I don't even know how create a buffer with charset:windows-1251.

you don't actually need this - you'll just see characters with another
font..

 HE> It's probably good to set swank::*log-events* to true and/or use
 HE> ethereal.

i've redirected log into file and saw where problem is.. i've expected
somthing like that..

WRITE: (:return (:ok ("2004-05-01" -1. "CLISP" "clisp" (:clos :loop
:compiler :clisp :ansi-cl :common-lisp :lisp=cl :interpreter :sockets
:generic-streams :logical-pathnames :screen :ffi :unicode
:base-char=character :pc386 :win32))) 1.)
DISPATCHING:
(:DEBUG 0 1
 ("Character #\\u00E7 cannot be represented in the character set
CHARSET:CP1251"
  "   [Condition of type SIMPLE-CHARSET-TYPE-ERROR]")

as i understand this is the length of message as char..
looks like it's not good to encode bytes as chars - it's a problem with some
charsets, representing it in hex or base64 can be much more portable..

by the way, there's one more issue with charsets - prin1-to-string function
can exceptionize (in this case slime hangs(but can be ressurected then)). i
think condition-hanler can help here - at least tell user about problem..
you can check it in such way:

(setq *str* "abc")
(progn (setf (char *str* 1) #\CYRILLIC_SMALL_LETTER_ER) ())
*str*

)
(With-best-regards '(Alex Mizrahi) :aka 'killer_storm)
(prin1 "Jane dates only Lisp programmers"))





More information about the slime-devel mailing list