+2010-02-06 Kevin Rosenberg <kevin@rosenberg.net>
+ * Version 1.8.1
+ * src/i18n.lisp: Add new function foreign-encoded-string-octets
+
2010-02-06 Kevin Rosenberg <kevin@rosenberg.net>
* Version 1.8.0
* src/strings.lisp: Initial support for external-formats with
+cl-uffi (1.8.1-1) unstable; urgency=low
+
+ * New upstream
+
+ -- Kevin M. Rosenberg <kmr@debian.org> Sun, 07 Feb 2010 02:34:52 -0700
+
cl-uffi (1.8.0-1) unstable; urgency=low
* New upstream
(defun implementation-foreign-encoding (normalized)
(cdr (assoc normalized *foreign-encoding-mapping* :test 'eql)))
+
+(defun foreign-encoded-string-octets (str &optional foreign-encoding)
+ "Returns the octets required to represent the string when passed to a ~
+foreign function."
+ ;; AllegroCL, CCL, and Lispworks give correct value without converting
+ ;; to external-format. CLISP, like SBCL, requires conversion with external-
+ ;; format
+ (length #+(and sbcl sb-unicode)
+ (sb-ext:string-to-octets
+ str
+ :external-format (or foreign-encoding
+ *default-foreign-encoding*
+ :utf-8))
+ #-(and sbcl sb-unicode) str))