anchor.diff:  	   (:single-byte-mode (encode-unit*/single-byte-mode state code-point write-func))
   	   (:unicode-mode (encode-unit*/unicode-mode state code-point write-func))))))
   
  +(defun encode-from-string (string
  +			   &key (src-start 0) (src-end (length string))
  +			     (bytes (make-array (length string) ; no way to expect length..
  +						:fill-pointer 0 :adjustable t
  +						:element-type '(unsigned-byte 8)))
  +			     (dst-start 0) ; TODO: change name to ":start1, :start2"?
  +			     (dst-end (length bytes))
  +			     (state (make-instance 'scsu-state)))
  +  (declare (type string string)
  +	   (type (array (unsigned-byte 8) *) bytes)	   
  +	   (type fixnum src-start src-end dst-start dst-end))
  +  (with-writing-function (put-byte current)
  +      (bytes dst-start dst-end :element-type (unsigned-byte 8))
  +    (loop for i of-type fixnum from src-start below src-end
  +       as c = (char string i)
  +       do (encode-unit* state (char-code c) #'put-byte))
  +    (values bytes current state)))
   
   ;; The required length is out of BMP case.
   ;; - SQU, <high surrogate 1>, <high surrogate 2>, SQU, <low surrogate 1>, <low surrogate 2>
  
positive.code: 	  (t
  	   code-point))))
  
  (defun decode-unit-to-bytes (bytes &key (start 0) (end (length bytes))
  				     (state (make-instance 'scsu-state)))
    (declare (type fixnum start end)
  	   (type (array (unsigned-byte 8) *) bytes))
    (let ((current start))
      (declare (type fixnum current))
      (flet ((pick-byte ()
  	     (cond ((< current end)
  		    (prog1 (aref bytes current)
  		      (incf current)))
  		   (t
  		    (error 'scsu-decode-error :format-control "Reached to the end of the bytes")))))
        (values (decode-unit* state #'pick-byte) current state))))
  
  (defun decode-to-string (bytes
  			 &key (src-start 0) (src-end (length bytes))
  			   (string (make-array (floor (length bytes) 2) ; no way to expect length..
  
negative.code: 	   (type fixnum src-start src-end dst-start dst-end)
  	   (type string string))
    ;; TODO: merge with above?
    ;; TODO: Don't reduce to last bytes..
    (with-reading-function (pick-byte src-current)
        (bytes src-start src-end)
      (with-writing-function (put-char dst-current)
  	(string dst-start dst-end :element-type character)
        (loop while (< src-current src-end) ; TODO: should return even after a completed control byte.
  	 as code-point = (decode-unit* state #'pick-byte)
  	 do (put-char (code-char code-point)))
        (values string dst-current state src-current))))
  
  (defun decode-unit-to-bytes (bytes &key (start 0) (end (length bytes))
  				     (state (make-instance 'scsu-state)))
    (let* ((ret-list (multiple-value-list 
  		    (decode-to-string bytes :src-start start :src-end end :state state)))
  	 (ret-string (first ret-list)))
      (apply #'values (char ret-string 0) (rest ret-list))))
  
  
  ;;; Encode
  