finally (return array)))))))
#!+sb-unicode
((simple-array base-char (*))
- ;; On unicode builds BASE-STRINGs are limited to ASCII range, so we can take
- ;; a fast path -- and get benefit of the element type information. On non-unicode
- ;; build BASE-CHAR == CHARACTER.
+ ;; On unicode builds BASE-STRINGs are limited to ASCII range,
+ ;; so we can take a fast path -- and get benefit of the element
+ ;; type information. On non-unicode build BASE-CHAR ==
+ ;; CHARACTER.
(ascii-bash))
((simple-array nil (*))
- ;; Just get the error...
- (aref string sstart)))))
+ (if (= send sstart)
+ (make-array 0 :element-type '(unsigned-byte 8))
+ ;; Just get the error...
+ (aref string sstart))))))
\f
;;;; to-string conversions
)
-;; regression test: STRING->UTF8 didn't properly handle a non-zero
-;; START argument.
+;;; regression test: STRING->UTF8 didn't properly handle a non-zero
+;;; START argument.
(assert (equalp #(50) (string-to-octets "42" :start 1 :external-format :utf-8)))
+
+;;; STRING->UTF8 should cope with NIL strings if a null range is required
+(assert (equalp #() (string-to-octets "" :external-format :utf-8)))
+(assert (equalp #() (string-to-octets (make-array 0 :element-type nil)
+ :external-format :utf-8)))
+(assert (equalp #() (string-to-octets (make-array 5 :element-type nil)
+ :start 3 :end 3 :external-format :utf-8)))
;;; checkins which aren't released. (And occasionally for internal
;;; versions, especially for internal versions off the main CVS
;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"1.0.30.47"
+"1.0.30.48"