public function toArray(array $opts = array())
    {
        $charset = array_key_exists('charset', $opts)
            ? (empty($opts['charset']) ? 'UTF-8' : $opts['charset'])
            : null;
        $eol = empty($opts['canonical'])
            ? $this->_eol
            : "\r\n";
        $ret = array();

        foreach ($this->_headers as $ob) {
            $sopts = array(
                'charset' => $charset
            );

            if (($ob instanceof Horde_Mime_Headers_Addresses) ||
                ($ob instanceof Horde_Mime_Headers_AddressesMulti)) {
                if (!empty($opts['defserver'])) {
                    $sopts['defserver'] = $opts['defserver'];
                }
            } elseif ($ob instanceof Horde_Mime_Headers_ContentParam) {
                $sopts['broken_rfc2231'] = !empty($opts['broken_rfc2231']);
                if (!empty($opts['lang'])) {
                    $sopts['lang'] = $opts['lang'];
                }
            }

            $tmp = array();

            foreach ($ob->sendEncode(array_filter($sopts)) as $val) {
                if (empty($opts['nowrap'])) {
                    /* Remove any existing linebreaks and wrap the line. */
                    $htext = $ob->name . ': ';
                    $val = ltrim(
                        substr(
                            wordwrap(
                                $htext . strtr(trim($val), array("\r" => '', "\n" => '')),
                                76,
                                $eol . ' '
                            ),
                            strlen($htext)
                        )
                    );
                }

                $tmp[] = $val;
            }

            $ret[$ob->name] = (count($tmp) == 1)
                ? reset($tmp)
                : $tmp;
        }

        return $ret;
    }