ARNESI

Manipulating strings 

Converting strings to/from foreign encodings 

CLISP 

#+(and clisp unicode)
(progn
  (defun encoding-keyword-to-native (encoding)
    (intern (string encoding) (find-package :charset)))
  (defun %string-to-octets (string encoding)
    (ext:convert-string-to-bytes string (encoding-keyword-to-native encoding)))
  (defun %octets-to-string (octets encoding)
    (ext:convert-string-from-bytes octets (encoding-keyword-to-native encoding))))

SBCL 

#+(and sbcl sb-unicode)
(progn
  (defun encoding-keyword-to-native (encoding)
    (ecase encoding
      (:utf-8 :utf8)
      (:utf-16 :utf16)
      (:us-ascii :us-ascii)
      (t encoding)))
  (defun %string-to-octets (string encoding)
    (sb-ext:string-to-octets string :external-format (encoding-keyword-to-native encoding)))
  (defun %octets-to-string (octets encoding)
    (sb-ext:octets-to-string octets :external-format (encoding-keyword-to-native encoding))))

Default Implementation 

#-(or (and sbcl sb-unicode) (and clisp unicode))
(progn
  (defun %string-to-octets (string encoding)
    (declare (ignore encoding))
    (map-into (make-array (length string) :element-type 'unsigned-byte)
              #'char-code string))
  
  (defun %octets-to-string (octets encoding)
    (declare (ignore encoding))
    (map-into (make-array (length octets) :element-type 'character)
              #'code-char octets)))