Convert subject to list.
This commit is contained in:
parent
947e1c8771
commit
418468f46e
3 changed files with 12 additions and 4 deletions
|
@ -313,7 +313,8 @@ UTIL-PROC-SOURCES=util-proc.scm
|
|||
util-proc.o: util-proc.import.scm
|
||||
util-proc.import.scm: $(UTIL-PROC-SOURCES)
|
||||
|
||||
UTIL-MAIL-SOURCES=util-mail.scm util-io.import.scm
|
||||
UTIL-MAIL-SOURCES=util-mail.scm util-io.import.scm \
|
||||
util-string.import.scm
|
||||
|
||||
util-mail.o: util-mail.import.scm
|
||||
util-mail.import.scm: $(UTIL-MAIL-SOURCES)
|
||||
|
|
|
@ -35,14 +35,16 @@
|
|||
(import scheme
|
||||
(chicken base)
|
||||
(chicken keyword)
|
||||
util-io)
|
||||
util-io
|
||||
util-string)
|
||||
|
||||
;; All emails go to this override
|
||||
(define *mailto-override* (make-parameter "dominik.pantucek@trustica.cz"))
|
||||
|
||||
;; Encodes given UTF-8 string as quoted-printable
|
||||
(define (string->qp str)
|
||||
str)
|
||||
(let ((lst (string->list/utf8 str)))
|
||||
str))
|
||||
|
||||
;; Ensures the subject has proper encoding
|
||||
(define (encode-subject subj)
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
string-first+rest
|
||||
string-utf8?
|
||||
string-tests!
|
||||
string->list/utf8
|
||||
)
|
||||
|
||||
(import scheme
|
||||
|
@ -63,8 +64,12 @@
|
|||
;; Returns true, if given string contains UTF-8 characters
|
||||
(define (string-utf8? str)
|
||||
(let ((asciilen (string-length str))
|
||||
(utf8len (length (irregex-extract (irregex "." 'u) str))))
|
||||
(utf8len (length (string->list/utf8 str))))
|
||||
(not (= asciilen utf8len))))
|
||||
|
||||
;; Converts given UTF-8 string into a list of UTF-8 string characters.
|
||||
(define (string->list/utf8 str)
|
||||
(irregex-extract (irregex "." 'u) str))
|
||||
|
||||
;; Performs utils module self-tests.
|
||||
(define (string-tests!)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue