specify latin-1 as external format for read-whole-file
authorNikodemus Siivola <nikodemus@random-state.net>
Sun, 28 Apr 2013 13:38:02 +0000 (16:38 +0300)
committerNikodemus Siivola <nikodemus@random-state.net>
Sun, 28 Apr 2013 13:55:49 +0000 (16:55 +0300)
  The current implementation assumes a single-byte-per-char format;
  make that explicit.

jscl.lisp

index 6350f7c..a1c4dea 100644 (file)
--- a/jscl.lisp
+++ b/jscl.lisp
@@ -47,7 +47,7 @@
     (load (source-pathname (car input)))))
 
 (defun read-whole-file (filename)
-  (with-open-file (in filename)
+  (with-open-file (in filename :external-format :latin-1)
     (let ((seq (make-array (file-length in) :element-type 'character)))
       (read-sequence seq in)
       seq)))