Ben | 15 Feb 2005 23:48

sbcl unicode

I noticed the following code in strings.lisp:

#+(and sbcl sb-unicode)
(defun sbcl-naturalize-cstring (sap &key length (null-terminated-p t))
...
            ;; this will not work in sb-unicode
            (sb-kernel:copy-from-system-area sap 0
                                             result (* sb-vm:vector-data-offset
                                                       sb-vm:n-word-bits)
                                             (* length sb-vm:n-byte-bits))

what's the status of this?  how should one efficiently convert from a
known ucs4 alien byte array to a unicode sbcl string?

take care, B
Kevin Rosenberg | 15 Feb 2005 23:55
Favicon

Re: sbcl unicode

Ben wrote:
> (defun sbcl-naturalize-cstring (sap &key length (null-terminated-p t))
> ...
>            ;; this will not work in sb-unicode
>            (sb-kernel:copy-from-system-area sap 0
>                                             result (* 
>                                             sb-vm:vector-data-offset
>                                                       sb-vm:n-word-bits)
>                                             (* length sb-vm:n-byte-bits))
> 
> what's the status of this?  how should one efficiently convert from a
> known ucs4 alien byte array to a unicode sbcl string?

Depends upon what you mean by "known". The best supported way is to
convert the entire string. However, if you only want to efficiently
convert a subsequence of a foreign string to a sbcl unicode string,
that is not yet supported by UFFI for sbcl unicode. [Patches
welcomed].

--

-- 
Kevin Rosenberg
kevin@...

Gmane