X-Git-Url: http://dolda2000.com/gitweb/?p=lisp-utils.git;a=blobdiff_plain;f=charcode.lisp;h=486e679f7531a6a05132c455d933bf4e0e97eebb;hp=a572fc2d15ffa35a698298ad9484ff57c1e83599;hb=dfa6197cf07772bba6cc056c35672b7f8c4d0f3b;hpb=53d1dafed1900b44f42acacfd14c3beae1c3af22 diff --git a/charcode.lisp b/charcode.lisp index a572fc2..486e679 100644 --- a/charcode.lisp +++ b/charcode.lisp @@ -207,6 +207,18 @@ (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)) + ;;; ASCII (defun decode-ascii (byteseq charseq &key (start 0) (end (length byteseq)))