anchor.diff:  
   ;;; 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
  +(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
   ENCODING into a Lisp string and return it.  If POINTER is a null
  
positive.code:                      (foreign-string-length
                        pointer :encoding encoding :offset offset)))
            (mapping (lookup-mapping *foreign-string-mappings* encoding)))
        (multiple-value-bind (size new-end)
            (funcall (code-point-counter mapping) pointer offset (+ offset count))
          (let ((string (make-string size)))
            (funcall (decoder mapping) pointer offset new-end string 0)
            string)))))
  
negative.code: (defun null-terminator-len (encoding)
    (length (enc-nul-encoding (get-character-encoding encoding))))
  
  (defun lisp-string-to-foreign (string buffer bufsize &key (start 0) end offset
                                 (encoding *default-foreign-encoding*))
    (check-type string string)
    (when offset
      (setq buffer (inc-pointer buffer offset)))
    (with-checked-simple-vector ((string string) (start start) (end end))
      (declare (type simple-string string))
      (let ((mapping (lookup-mapping *foreign-string-mappings* encoding))
            (nul-len (null-terminator-len encoding)))
        (assert (plusp bufsize))
        (multiple-value-bind (size end)
            (funcall (octet-counter mapping) string start end (- bufsize nul-len))
          (funcall (encoder mapping) string start end buffer 0)
          (dotimes (i nul-len)
            (setf (mem-ref buffer :char (+ size i)) 0))))
      buffer))
  
  ;;; Expands into a loop that calculates the length of the foreign
  