diff --git a/src/filesystem-utils.lisp b/src/filesystem-utils.lisp index cba45ae..a282473 100644 --- a/src/filesystem-utils.lisp +++ b/src/filesystem-utils.lisp @@ -52,13 +52,13 @@ 0 (file-length stream)))) -(defun slurp-file (filename &key (convert-to-string t)) +(defun slurp-file (filename &key (convert-to-string t) (errorp nil)) "A simple way to slurp a file." (with-open-file (stream filename :direction :input :element-type '(unsigned-byte 8)) (let ((seq (make-array (file-length stream) :element-type '(unsigned-byte 8)))) (read-sequence seq stream) (if convert-to-string - (babel:octets-to-string seq) + (babel:octets-to-string seq :errorp errorp) seq)))) (defun dump-sequence-to-file (seq file) diff --git a/src/text-utils.lisp b/src/text-utils.lisp index 49d93aa..3ad729e 100644 --- a/src/text-utils.lisp +++ b/src/text-utils.lisp @@ -78,7 +78,7 @@ object) (defmethod to-s ((object vector)) - (coerce object 'string)) + (babel:octets-to-string object :errorp nil)) (defmethod to-s ((object character)) (string object))