Details
Description
http://xref.moodle.org/lib/bennu/iCalendar_rfc2445.php.html
contains function rfc2445_fold() which does not differ between "characters" and "octets". RFC2445 section 4.1
"Lines of text SHOULD NOT be longer than 75 octets"
"That is, a long line can be split between any two characters ..."
If one UTF8 character consists of two or more octets, the function happens to put them on different lines, causing importers, such as Thunderbird/Lightning, to reject the file, because it is no valid UTF8 anymore.
The rfc2445_unfold() function of the same file ignores the different consequentently, so it is not effected.
This patch alters the rfc2445_fold function in lib bennu so that it uses mb_strlen and mb_substr to fold the text at 75 utf8 characters. This has solved an issue with Thunderbird importing the iCal file where previously it was failing due to the fold occurring within a multi-byte glyph.
Should this fold at 75 octets and prevent the breaking of multi-byte characters? I'm not sure; libical chunk splits at 75 octets and this is possibly correct even for multi-byte strings, does the problem lie with Thunderbird? Should Thunderbird reconstruct the text in such a way that the multi-byte characters will be correctly recombined and then imported successfully..