diff options
Diffstat (limited to 'mail-filter/scmail/files/scmail-doc-encoding.patch')
-rw-r--r-- | mail-filter/scmail/files/scmail-doc-encoding.patch | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/mail-filter/scmail/files/scmail-doc-encoding.patch b/mail-filter/scmail/files/scmail-doc-encoding.patch new file mode 100644 index 000000000000..8740774379f9 --- /dev/null +++ b/mail-filter/scmail/files/scmail-doc-encoding.patch @@ -0,0 +1,28 @@ +--- a/doc/embed.scm ++++ b/doc/embed.scm +@@ -1,3 +1,4 @@ ++(use gauche.charconv) + (use gauche.regexp) + (define (escape str) + (set! str (regexp-replace-all #/&/ str "&")) +@@ -15,12 +16,18 @@ + (define (main args) + (call-with-input-file (cadr args) + (lambda (in) +- (let* ((content (port->string in)) ++ (let* ((content (port->string (open-input-conversion-port in "*jp"))) + (content (regexp-replace-all #/#\{(.*?)\}/ content + (lambda (m) + (string-append + "<pre>\n" + (read-file-and-escape (rxmatch-substring m 1)) +- "</pre>\n"))))) ++ "</pre>\n")))) ++ (content (regexp-replace #/(encoding=").*?(")/ content ++ (lambda (m) ++ (string-append ++ (rxmatch-substring m 1) ++ (ces-guess-from-string content "*jp") ++ (rxmatch-substring m 2)))))) + (display content)))) + 0) |