summaryrefslogtreecommitdiff
path: root/email
diff options
context:
space:
mode:
Diffstat (limited to 'email')
-rw-r--r--email/email.scm5
1 files changed, 4 insertions, 1 deletions
diff --git a/email/email.scm b/email/email.scm
index f276019..6ed285f 100644
--- a/email/email.scm
+++ b/email/email.scm
@@ -611,8 +611,11 @@ values. The returned headers is a string and body is a bytevector."
;; name, we relax this requirement. We assume an encoding of
;; UTF-8, and hope that everything turns out fine. Since UTF-8
;; is a superset of ASCII, this should not affect standards
- ;; conforming headers.
+ ;; conforming headers. If encoding is neither UTF-8 nor ASCII,
+ ;; we use the substitute conversion strategy and proceed without
+ ;; raising an error.
(set-port-encoding! port "utf-8")
+ (set-port-conversion-strategy! port 'substitute)
(let ((headers (read-while port get-line-with-delimiter
(lambda (line)
(not (or (string= line "\n")