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

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

parent 585aff9f
......@@ -177,9 +177,10 @@ Throws an error if the character encoding is not known."
"(" *crlfsp* *decoded-line-regexp* ")*")
: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*
("foo" "foo"))
:for result = (decode* encoded)
:do (ensure (string= decoded result)
:report "expected ~A, got ~A" :arguments (decoded result))))
(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
Supports Markdown
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