X-Git-Url: http://dolda2000.com/gitweb/?p=lisp-utils.git;a=blobdiff_plain;f=charcode.lisp;h=a3cb5ad0949eb3c0eef81652585ec704f497cdb9;hp=a572fc2d15ffa35a698298ad9484ff57c1e83599;hb=HEAD;hpb=53d1dafed1900b44f42acacfd14c3beae1c3af22 diff --git a/charcode.lisp b/charcode.lisp index a572fc2..a3cb5ad 100644 --- a/charcode.lisp +++ b/charcode.lisp @@ -197,12 +197,24 @@ ;;; 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))