From 1dcdea5a09358eee85be05287d5c4cbbb3df6a94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Wed, 18 Mar 2020 23:30:24 +0100 Subject: Handle non-utf summaries. --- module/vcomponent/parse.scm | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'module/vcomponent') diff --git a/module/vcomponent/parse.scm b/module/vcomponent/parse.scm index ef31cbd0..11aa8dec 100644 --- a/module/vcomponent/parse.scm +++ b/module/vcomponent/parse.scm @@ -182,11 +182,25 @@ row ~a column ~a ctx = ~a (set! component (parent component))] - [else + [else ; Regular key-value line ;; TODO repeated keys (let ((it (make-vline str (get-param-table ctx)))) ;; Type specific processing (case (get-line-key ctx) + ;; As far as I can tell the RFC says nothing about special + ;; encoding for individual fields. It mentieons UTF-8, and + ;; that transfer encoding should be set in the mime-headers. + ;; That however seems like a breach of abstractions. + ;; Currently I allow a CHARSET property on SUMMARY fields, + ;; since I know that at least www.lysator.liu.se/alma/alma.cgi + ;; uses it. + [(SUMMARY) + (cond [(and=> (prop it 'CHARSET) car) + => (lambda (encoding) + (set! (value it) + (strbuf->string strbuf ((@ (rnrs io ports) make-transcoder) + encoding))))])] + [(DTSTART DTEND RECURRENCE-ID) ;; '("Africa/Ceuta" "Europe/Stockholm" "local") -- cgit v1.2.3