[UFFI-Devel] utf8-string in sbcl

Yoshinori Tahara ancient at gpy1.ms246.net
Mon Feb 14 01:31:07 MST 2005


I have a problem when i use utf8-string in sbcl.
This patch may works fine.

--- primitives.lisp	2005-02-14 17:19:31.000000000 +0900
+++ work/primitives.lisp	2005-02-14 17:17:26.000000000 +0900
@@ -147,7 +147,8 @@
 (setq *type-conversion-list*
     '((* . *) (:void . sb-alien:void) 
       (:pointer-void . (* t))
-      (:cstring . sb-alien:c-string)
+      #-sb-unicode(:cstring . sb-alien:c-string)
+      #+sb-unicode(:cstring . sb-alien:utf8-string)
       (:char . sb-alien:char) 
       (:unsigned-char . (sb-alien:unsigned 8))
       (:byte . (sb-alien:signed 8))

--- strings.lisp	2005-02-14 17:19:31.000000000 +0900
+++ work/strings.lisp	2005-02-14 17:17:24.000000000 +0900
@@ -330,7 +330,7 @@
       (cond
         (null-terminated-p
 	 (let ((casted (sb-alien:cast
-			(sb-alien:sap-alien sap (* char)) sb-alien:c-string)))
+			(sb-alien:sap-alien sap (* char)) sb-alien:utf8-string)))
 	   (if length
 	       (copy-seq (subseq casted 0 length))
 	       (copy-seq casted))))


Thanks.
Yoshinori Tahara


More information about the UFFI-Devel mailing list