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.o: util-proc.import.scm
|
||||||
util-proc.import.scm: $(UTIL-PROC-SOURCES)
|
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.o: util-mail.import.scm
|
||||||
util-mail.import.scm: $(UTIL-MAIL-SOURCES)
|
util-mail.import.scm: $(UTIL-MAIL-SOURCES)
|
||||||
|
|
|
@ -35,14 +35,16 @@
|
||||||
(import scheme
|
(import scheme
|
||||||
(chicken base)
|
(chicken base)
|
||||||
(chicken keyword)
|
(chicken keyword)
|
||||||
util-io)
|
util-io
|
||||||
|
util-string)
|
||||||
|
|
||||||
;; All emails go to this override
|
;; All emails go to this override
|
||||||
(define *mailto-override* (make-parameter "dominik.pantucek@trustica.cz"))
|
(define *mailto-override* (make-parameter "dominik.pantucek@trustica.cz"))
|
||||||
|
|
||||||
;; Encodes given UTF-8 string as quoted-printable
|
;; Encodes given UTF-8 string as quoted-printable
|
||||||
(define (string->qp str)
|
(define (string->qp str)
|
||||||
str)
|
(let ((lst (string->list/utf8 str)))
|
||||||
|
str))
|
||||||
|
|
||||||
;; Ensures the subject has proper encoding
|
;; Ensures the subject has proper encoding
|
||||||
(define (encode-subject subj)
|
(define (encode-subject subj)
|
||||||
|
|
|
@ -32,6 +32,7 @@
|
||||||
string-first+rest
|
string-first+rest
|
||||||
string-utf8?
|
string-utf8?
|
||||||
string-tests!
|
string-tests!
|
||||||
|
string->list/utf8
|
||||||
)
|
)
|
||||||
|
|
||||||
(import scheme
|
(import scheme
|
||||||
|
@ -63,9 +64,13 @@
|
||||||
;; Returns true, if given string contains UTF-8 characters
|
;; Returns true, if given string contains UTF-8 characters
|
||||||
(define (string-utf8? str)
|
(define (string-utf8? str)
|
||||||
(let ((asciilen (string-length str))
|
(let ((asciilen (string-length str))
|
||||||
(utf8len (length (irregex-extract (irregex "." 'u) str))))
|
(utf8len (length (string->list/utf8 str))))
|
||||||
(not (= asciilen utf8len))))
|
(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.
|
;; Performs utils module self-tests.
|
||||||
(define (string-tests!)
|
(define (string-tests!)
|
||||||
(run-tests
|
(run-tests
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue