anchor.diff:  ;;; argument which is used to specify the encoding to use when
   ;;; converting to/from foreign strings.
   
  -;;; FIXME: is this a good default? [2007-04-13 LO]
  -;;;
  -;;; :LATIN-1 would probably work better for 8-bit lisps and be
  -;;; backwards compatible with previous encoding unaware CFFI
  -;;; behaviour.  OTOH, most uses are probably counting on
  -;;; ASCII-compatible behaviour?  [2007-06-07 LO]
  -(defvar *default-foreign-encoding* :utf-8)
  +(defvar *default-foreign-encoding* :utf-8
  +  "Default foreign encoding.")
   
   ;;; TODO: refactor, sigh.  Also, this should probably be a function.
  -;;; Would have to change Babel's API for that to be possible, I think.
   (defmacro bget (ptr off &optional (bytes 1) (endianness :ne))
     (let ((big-endian (member endianness
                               '(:be #+big-endian :ne #+little-endian :re))))
  
positive.code:     (2 (%foreign-string-length pointer offset :uint16 2))
      (4 (%foreign-string-length pointer offset :uint32 4))))
  
  ;;; what to do with COUNT here? ahrg... make it default to STRLEN? but
  ;;; what about the "at most" part?
  (defun foreign-string-to-lisp (pointer &key (offset 0) count max-chars
                                 (encoding *default-foreign-encoding*))
    "Copy at most COUNT bytes from POINTER plus OFFSET encoded in
  
negative.code:     (format stream "~S" (fst-encoding type))))
  
  (defmethod translate-to-foreign ((s string) (type foreign-string-type))
    (values (foreign-string-alloc s :encoding (fst-encoding type))
            (fst-free-to-foreign-p type)))
  
  (defmethod translate-to-foreign (obj (type foreign-string-type))
    (cond
      ((pointerp obj)
       (values obj nil))
      ;; FIXME: we used to support UB8 vectors but not anymore.
      ;; ((typep obj '(array (unsigned-byte 8)))
      ;;  (values (foreign-string-alloc obj) t))
      (t (error "~A is not a Lisp string or pointer." obj))))
  
  (defmethod translate-from-foreign (ptr (type foreign-string-type))
    (unwind-protect
         (values (foreign-string-to-lisp ptr :encoding (fst-encoding type)))
      (when (fst-free-from-foreign-p type)
        (foreign-free ptr))))
  
  (defmethod free-translated-object (ptr (type foreign-string-type) free-p)
    (when free-p
  