Hi Rick,
I wrote an RFC2445 implementation myself (for
www.supersaas.com) which
is not nearly as nice as yours, so 'm looking to replace part of it
with your hard work.
On thing I noticed so far is that your "FoldingStream" class simply
inserts a new line after every 72 bytes to comply with the folding
requirement. The problem with that is that it has a large change of
splitting a multi-byte UTF-8 character right in the middle for non-US
languages. I can tell you from experience that most iCal software will
then convert that into garbage characters.
There are two solutions:
1 - use something like the ActiveSupport String::mb_chars.insert(50,"\r
\n "). Note that you cannot simply insert at character 78 since a
character can take multiple bytes. Not very elegant and very compute
intensive to do it right.
2 - simply don't wrap at all, I have tested it with a several iCal
aware programs and none of them seem to mind. By the way, the RFC says
to insert a CRLF instead of the '/n' you insert and none of them seem
to mind either. Also, Outlook and Apple's iCal don't seem to wrap
properly either so you're probably safe.
Cheers,
Jan