From ae688fd185c90ceba7a5bc28c1704e42c69f5306 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Fri, 14 Sep 2018 20:53:04 +0530 Subject: quoted-printable: Encode #\= with its ASCII code. * email/quoted-printable.scm (quoted-printable-encode): Encode #\= with its ASCII code. * test/quoted-printable.scm (quoted-printable-encoding of =): Add test to check for this bug. --- email/quoted-printable.scm | 6 ++++-- tests/quoted-printable.scm | 6 ++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/email/quoted-printable.scm b/email/quoted-printable.scm index 753d7ae..d119f6a 100644 --- a/email/quoted-printable.scm +++ b/email/quoted-printable.scm @@ -80,8 +80,10 @@ in out (put-into-output (if (char-set-contains? - (ucs-range->char-set (char->integer #\space) - (char->integer #\delete)) + (char-set-delete + (ucs-range->char-set (char->integer #\space) + (char->integer #\delete)) + #\=) c) (string c) (format #f "=~:@(~2,'0x~)" x)))))))))) diff --git a/tests/quoted-printable.scm b/tests/quoted-printable.scm index 608a937..f3dd5eb 100755 --- a/tests/quoted-printable.scm +++ b/tests/quoted-printable.scm @@ -49,6 +49,12 @@ abriquent pour te la vendre une =C3=A2me vulgaire.") (string->bytevector decoded-text charset)) #\newline)))) +(test-equal "quoted-printable encoding of =" + (quoted-printable-encode + (string->bytevector "=" "UTF-8")) + (string-append "=" (string-upcase (number->string + (char->integer #\=) 16)))) + (let ((encoded-text "=A1Hola,_se=F1or!") (decoded-text "¡Hola, señor!") (charset "ISO-8859-1")) -- cgit v1.2.3