[cffi-devel] utf-16

Helmut Eller heller at common-lisp.net
Tue Jun 1 10:41:06 UTC 2010


* Luís Oliveira [2010-06-01 10:43+0200] writes:

> On Tue, Jun 1, 2010 at 7:51 AM, Helmut Eller <heller at common-lisp.net> wrote:
>> Thanks. I will write my on decoder then.
>
> But please do contribute it to Babel. :-)

Well, it's trivial for my case:

(defun domstring-to-lisp (data length)
  (declare (type fixnum length))
  (let ((string (make-string length)))
    (dotimes (i length)
      (setf (aref string i) (code-char (cffi:mem-aref data :uint16 i))))
    string))

Helmut





More information about the cffi-devel mailing list