+ #+lispworks
+ ;; With LW 6.0, writing multibyte character just one octet at a time
+ ;; produces expected formatted output, but strings lengths are too
+ ;; long and consists only of octets, not wide characters
+ ;;
+ ;; Below technique of using fli:convert-from-foreign-string works tp
+ ;; correctly create string of wide-characters. However, errors occur
+ ;; during formatted printing of such strings with an error such as
+ ;; "#\U+30D3 is not of type BASE-CHAR"
+ (let ((fe (gensym "FE-"))
+ (ife (gensym "IFE-"))
+ (oct (gensym "OCTETS-")))
+ `(let* ((,fe (or ,encoding *default-foreign-encoding*))
+ (,ife (when ,fe (lookup-foreign-encoding ,fe)))
+ (,oct ,octets))
+ (fli:with-dynamic-foreign-objects
+ ((ptr (:unsigned :byte) :initial-contents (coerce ,oct 'list)))
+ (fli:convert-from-foreign-string ptr
+ :length (length ,oct)
+ :null-terminated-p nil
+ :external-format ,ife))))
+
+ #+(or ccl openmcl)
+ ;; With CCL 1.5, writing multibyte character just one octet at a time tests fine