Commit 1c8f3faf authored by ch's avatar ch
Browse files

Fixed wrong handling in decode* of strings w/o encoded content.

darcs-hash:20080518113255-c72ca-c97d6ac6d4a0b194a0d235f85ed1c0d54d292a29
parent 585aff9f
......@@ -177,9 +177,10 @@ Throws an error if the character encoding is not known."
"(" *crlfsp* *decoded-line-regexp* ")*")
str)
:by #'cddr
:if (not (= x start)) :do (princ (subseq str x start) stream)
:unless (= x start) :do (princ (subseq str x start) stream)
:do (princ (decode str :start start :end end) stream)
:finally (let ((strlen (length str)))
(unless (= end strlen)
(princ (subseq str end strlen) stream))
:finally (let ((end* (if (null end) 0 end))
(strlen (length str)))
(unless (= end* strlen)
(princ (subseq str end* strlen) stream))
(return (get-output-stream-string stream)))))
......@@ -39,12 +39,8 @@
"some foo bar bazbla")
(,(cl-rfc2047::string+ "some=?uTf-8?b?Zm9v?=" cl-rfc2047::*crlfsp*
"=?uTf-8?b?YmF6?=bar")
"somefoobazbar"))
"somefoobazbar")
("foo" "foo"))
:for result = (decode* encoded)
:do (ensure (string= decoded result)
:report "expected ~A, got ~A" :arguments (decoded result))))
(run-test)
(describe (run-test))
(run-tests :suite 'encode-tests)
\ No newline at end of file
:report "expected ~A, got ~A" :arguments (decoded result))))
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment