First: Thanks for a nice module - it seems promising for my current project :)
Im not sure if this is the right place for these questions, or if they belong in the mapper - maybe someone can guide me there.
I have 2 challenges.
1) the .ics file I get from the external system is encoded in ANSI. This makes problems with accented characters ("Stabsmøte" is imported as "Stabsm"). When file is converted to ANSI as UTF-8 (with Notepad++) it works fine.
2) the .ics file I get from the external system lacks the UID-field. Events without UID-field are obviously not converted to nodes (adding a UID to my existing file proves that). Question: Is UID really mandatory? I cannot find any such info in iCal specifications.
Sample from my .ics-file:
BEGIN:VEVENT
DTSTART:20090602T083000
DTEND:20090602T103000
SUMMARY:Stabsmøte
END:VEVENT
BEGIN:VEVENT
DTSTART:20090602T140000
DTEND:20090602T180000
SUMMARY:Ut med staben
END:VEVENT
Thanks
Roald#
Comments
Comment #1
ekes commentedDiscussion on the UID is here:- http://drupal.org/node/378528 it is mandatory according to http://www.apps.ietf.org/rfc/rfc2445.html#sec-4.8.4.7 but is frequently not there so the parser tries its best, but the issue above relates to the problems creating one that's not causing problems.
Comment #2
ekes commentedThe UTF-8 part is certainly frustrating. I'm guessing the best thing is if the HTTP header Content-Type includes a charset=SOMETHING_NOT_UTF-8 it uses it to convert it. A random survey of headers however suggests this isn't going to help much (content-type is frequently not there, in fact I've not found one for anything other than UTF-8 yet). There is no iCal equivalent to the meta content encoding header from HTML. Don't know if anyone has a better suggestion?
Comment #3
LouisStAmour commentedAn update for those frustrated by character encoding in ical -- not just from the feeds module -- it turns out you have to handle the encoding *after* quoted_printable_decode since "Quoted Printable" is expressly designed to um, only return ASCII-printable characters.
I had to open date module and hack date_api_ical.inc to insert a call to iconv after the quoted_printable_decode is performed.
A more flexible method might be http://carlocapocasa.com/utf-8-and-iso-8859-1-in-emails/ though it does the reverse in IMAP. Technically, though I don't know if my calendar feed followed this or not, it's common with IMAP to send emails in different character sets by specifying the encoding in a bit of a magic string: '=?ISO-8859-1?Q?' or '=?UTF-8?B?' See https://www.google.ca/search?q='%3D%3FISO-8859-1%3FQ%3F'
Related PHP functions: imap_utf8, iconv_mime_decode
That said, all the above Q or B (with question marks) encoding strings are for IMAP and defined in RFC 2047.
The iCal RFC only has this to say:
Which means we'd have to modify API calls to pass the encoding successfully through to the date API for iCal. It's probably not much work, but I don't have the time right now, so I'm sharing this for others also confused as to why iCal in Drupal cuts off after special characters are used ...
Sadly, in my instance, the feed never gave a charset parameter beyond Content-Type: text/calendar, so I'd have to manually override it on a feed-by-feed basis (or rely on auto-detection on a string-by-string basis).