Loading trivial-utf-8.lisp +24 −24 Original line number Diff line number Diff line Loading @@ -154,7 +154,7 @@ extract the character starting at the given start position." the string it encodes." (declare (type (array (unsigned-byte 8)) bytes) #.*optimize*) (loop :with buffer = (make-string (utf-8-string-length bytes)) (loop :with buffer = (make-string (utf-8-string-length bytes) :element-type 'character) :with array-position = 0 :with string-position = 0 :with array-length = (length bytes) Loading @@ -172,7 +172,7 @@ the string it encodes." :finally (return buffer))) (defun read-utf-8-string (input &key null-terminated stop-at-eof char-length byte-length) (char-length -1) (byte-length -1)) "Read utf-8 encoded data from a byte stream and construct a string with the characters found. When null-terminated is given it will stop reading at a null character, stop-at-eof tells it to Loading @@ -187,8 +187,8 @@ max amount of characters or bytes to read." (string (make-array 64 :element-type 'character :adjustable t :fill-pointer 0))) (loop (when (or (and byte-length (>= bytes-read byte-length)) (and char-length (= char-length (length string)))) (when (or (and (/= -1 byte-length) (>= bytes-read byte-length)) (and (/= -1 char-length) (= char-length (length string)))) (return)) (let ((next-char (read-byte input (not stop-at-eof) :eof))) (when (or (eq next-char :eof) Loading Loading
trivial-utf-8.lisp +24 −24 Original line number Diff line number Diff line Loading @@ -154,7 +154,7 @@ extract the character starting at the given start position." the string it encodes." (declare (type (array (unsigned-byte 8)) bytes) #.*optimize*) (loop :with buffer = (make-string (utf-8-string-length bytes)) (loop :with buffer = (make-string (utf-8-string-length bytes) :element-type 'character) :with array-position = 0 :with string-position = 0 :with array-length = (length bytes) Loading @@ -172,7 +172,7 @@ the string it encodes." :finally (return buffer))) (defun read-utf-8-string (input &key null-terminated stop-at-eof char-length byte-length) (char-length -1) (byte-length -1)) "Read utf-8 encoded data from a byte stream and construct a string with the characters found. When null-terminated is given it will stop reading at a null character, stop-at-eof tells it to Loading @@ -187,8 +187,8 @@ max amount of characters or bytes to read." (string (make-array 64 :element-type 'character :adjustable t :fill-pointer 0))) (loop (when (or (and byte-length (>= bytes-read byte-length)) (and char-length (= char-length (length string)))) (when (or (and (/= -1 byte-length) (>= bytes-read byte-length)) (and (/= -1 char-length) (= char-length (length string)))) (return)) (let ((next-char (read-byte input (not stop-at-eof) :eof))) (when (or (eq next-char :eof) Loading