anchor.diff:    (declare (type fixnum start end)
   	   (type (array (unsigned-byte 8) *) bytes))
     (check-type code-point (integer 0 #x10FFFF))
  -  (let ((current start))
  -    (declare (type fixnum current))
  -    (flet ((put-byte (byte)
  -	     (declare (type (unsigned-byte 8) bytes))
  -	     (cond ((< current end)
  -		    (setf (aref bytes current) byte)
  -		    (incf current))
  -		   ((array-has-fill-pointer-p bytes)
  -		    (vector-push-extend byte bytes) ; TODO: wrap error.
  -		    (incf current))
  -		   (t
  -		    (error 'scsu-encode-error
  -			   :format-control "Reached to the end of the bytes")))))
  -      (encode-unit* state code-point #'put-byte)
  -      (values bytes current state))))
  -
  -(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)
  -			     (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))
  -  ;; TODO: merge with above?
  -  (let ((current dst-start))
  -    (declare (type fixnum current))
  -    (flet ((put-byte (byte)
  -	     (declare (type (unsigned-byte 8) bytes))
  -	     (cond ((< current dst-end)
  -		    (setf (aref bytes current) byte)
  -		    (incf current))
  -		   ((array-has-fill-pointer-p bytes)
  -		    (vector-push-extend byte bytes) ; TODO: wrap error.
  -		    (incf current))
  -		   (t
  -		    (error 'scsu-encode-error
  -			   :format-control "Reached to the end of the bytes")))))
  -      (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))))
  -
  +  (let ((tmp-string (make-array 1 :element-type 'character)))
  +    (declare (type simple-string tmp-string)
  +	     (dynamic-extent tmp-string))
  +    (setf (schar tmp-string 0) code-point)
  +    (encode-from-string tmp-string :src-start 0 :src-end 1
  +			:bytes bytes :dst-start start :dst-end end :state state)))
  
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: 
  (define-condition scsu-decode-error (scsu-error)
    ())
  
  
  ;;; Util
  (defmacro with-reading-function ((function current)
  				 (buffer start end &key (element-type '(unsigned-byte 8)))
  				 &body body)
    (alexandria:once-only (buffer start end)
      `(locally (declare (type fixnum ,start ,end)
  		       (type (array ,element-type (*)) ,buffer))
         (let ((,current ,start))
  	 (declare (type fixnum ,current))
  	 (flet ((,function ()
  		  (cond ((< ,current ,end)
  			 (prog1 (aref ,buffer ,current)
  			   (incf ,current)))
  			(t
  			 (error 'scsu-error :format-control "Reached to the end of the buffer")))))
  	   ,@body)))))
  
  (defmacro with-writing-function ((function current)
  				 (buffer start end &key (element-type '(unsigned-byte 8)))
  				 &body body)
    (alexandria:once-only (buffer start end)
      `(locally (declare (type fixnum ,start ,end)
  		       (type (array ,element-type (*)) ,buffer))
         (let ((,current ,start))
  	 (declare (type fixnum ,current))
  	 (flet ((,function (c)
  		  (cond ((< ,current ,end)
  			 (setf (aref ,buffer ,current) c)
  			 (incf ,current))
  			((array-has-fill-pointer-p ,buffer)
  			 (vector-push-extend c ,buffer) ; TODO: wrap error from outer.
  			 (incf ,current))
  			(t
  			 (error 'scsu-error :format-control "Reached to the end of the string")))))
  	   ,@body)))))
  
  
  ;;; Decoder
  