Fixed up Unix sockets a bit.
[lisp-utils.git] / charcode.lisp
index a572fc2..a3cb5ad 100644 (file)
 
 ;;; Implementation-specific functions
 
-#+(or (and clisp unicode) sbcl)
+#+(or (and clisp unicode) sbcl abcl)
 (defun unicode->char (unicode)
   (declare (type (unsigned-byte 24) unicode))
   (code-char unicode))
 
-#+(or (and clisp unicode) sbcl)
+#+(or (and clisp unicode) sbcl abcl)
+(defun char->unicode (char)
+  (declare (type character char))
+  (char-code char))
+
+#+ecl
+(defun unicode->char (unicode)
+  (declare (type (unsigned-byte 24) unicode))
+  (when (>= unicode 256)
+    (error "ECL does not handle Unicode characters outside Latin-1."))
+  (code-char unicode))
+
+#+ecl
 (defun char->unicode (char)
   (declare (type character char))
   (char-code char))