- New fn QP-UTF8
authorMaciej Pasternacki <maciej@pasternacki.net>
Sun, 30 Nov 2008 17:40:28 +0000 (30 18:40 +0100)
committerMaciej Pasternacki <maciej@pasternacki.net>
Sun, 30 Nov 2008 17:40:28 +0000 (30 18:40 +0100)
src/common.lisp

index 863fabd..a983482 100644 (file)
@@ -11,7 +11,7 @@
            #:dirtiness-mixin #:dirty-p #:mark-as-dirty #:update-dao-if-dirty
            #:cache-dao #:with-dao-cache
            #:*config* #:init-config #:*db* #:init-db-connection #:execute*
-           #:unless-null #:null-or #:invoke-sendmail
+           #:unless-null #:null-or #:qp-utf8 #:invoke-sendmail
            #:report-error #:report-error-by-email #:report-error-to-file #:format-error-report
            #:*error-context-hook* #:*error-report-pathname-defaults*
            #:make-keyword #:named-lambda #:random-string #:salted-password #:hex-md5
@@ -190,6 +190,10 @@ lists of statements."
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; Mailing
 
+(defun qp-utf8 (string)
+  "Encode STRING as quoted-printable UTF-8"
+  (cl-qprint:encode (map 'string #'code-char (trivial-utf-8:string-to-utf-8-bytes string))))
+
 (defun invoke-sendmail (sender rcpt body-and-headers
                         &key (sendmail-binary (py-configparser:get-option *config* "mailing" "sendmail")) )
   "Invoke sendmail binary.