[sync] Horde::Data vs iCalendar package

Karsten Fourmont fourmont at gmx.de
Thu Jul 1 01:12:01 PDT 2004


Hi,

it seems I put my money on the wrong horse :-)

I looked at kronlith and mnemo and guessed that Horde::Data rather than
iCalendar would be the method of choice. Horde::Data is used in the api
export as well as in gui-menu driven import/export while iCalendar is only
used in api import. 

OK, if iCalendar is the way to go, that's fine with me, too. 

> - Horde_iCalendar should handle charsets
> - Horde_Data should handle iCalendar data via the Horde_iCalendar class,
> just
>    providing the Horde_Data compatible API to it, instead of
> re-implementing
>    parsing.

Sounds good to me.

Even if inline specification of charsets  is no longer according to spec,
horde should accept it in imports. Phones are sending it that way. Well: at
least my phone does :-)


The charset handling code of Horde::Data/imc.php missing in iCalendar  is:

    function read($attribute, $index = 0)
    {
        $value = $attribute['values'][$index];

        if (isset($attribute['params']['ENCODING'])) {
            switch ($attribute['params']['ENCODING'][0]) {
            case 'QUOTED-PRINTABLE':
                $value = quoted_printable_decode($value);
                break;
            }
        }

        if (isset($attribute['params']['QUOTED-PRINTABLE']) &&
($attribute['params']['QUOTED-PRINTABLE'] == true)) {
            $value = quoted_printable_decode($value);
        }

        if (isset($attribute['params']['CHARSET'])) {
            $value = String::convertCharset($value,
$attribute['params']['CHARSET'][0]);
        } else {
            // As per RFC 2279, assume UTF8 if we don't have an
            // explicit charset parameter.
            $value = String::convertCharset($value, 'utf-8');
        }

        return $value;
    }


It relies on attribute being parsed for params. Im not sure if this is done
in iCalendar already. The inline params look like this:

BEGIN:VNOTE
VERSION:1.1
BODY;ENCODING=QUOTED-PRINTABLE:Here_comes_a_space:=20Did_you_get_it?
END:VNOTE

Bye
 Karsten
 



More information about the sync mailing list