Guest User

reading utf-8 data from a file

a guest
Jun 16th, 2018
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. (define-test test-read-header
  2. (:tags '(p-tests) :contexts (list #'setup))
  3. (let* ((p (merge-pathnames #p"test/inputs.txt" config::*APP-ROOT*)))
  4. (with-open-file (s p :direction :input :element-type '(unsigned-byte 8) :external-format '(:utf-8 :replacement #\?))
  5. (assert-equalp 129 (read-byte s)))))
  6.  
  7. ;; I get 49 when expecting 129
  8. ;;The first six bytes of inputs.txt are: 129 0 0 0 0 126
Add Comment
Please, Sign In to add comment