CLISP string size
CLISP でも文字列のサイズを調べたい。以下のようにすればできるようだ。
(defun utf-8-string-byte-size (s) (if (stringp s) (length (ext:convert-string-to-bytes s (ext:encoding-charset "UTF-8"))) 0))
Clozure CL とハイプリッドにするには以下のようにすればいい、、、はず。
(defun utf-8-string-byte-size (s) (if (stringp s) #+CCL (string-size-in-octets s :external-format :UTF-8) #+CLISP (length (ext:convert-string-to-bytes s (ext:encoding-charset "UTF-8"))) 0))