ZF-7636: Decoding folder name

Description

Folder name have to be decoded when they contents accents :

"Messages envoy&AOk-s" => "Messages envoyés"

In my application I have overloaded the class 'Zend_Mail_Storage_Folder' with this code :

class Mail_Storage_Folder extends Zend_Mail_Storage_Folder {

    protected static $_decode = array('&-' => '&',
                                    '&AOk-' => 'é',
                                    '&AOI-' => 'â',
                                    '&AOA-' => 'à',
                                    '&AOg-' => 'è',
                                    '&AOc-' => 'ç',
                                    '&APk-' => 'ù',
                                    '&AOo-' => 'ê',
                                    '&AO4-' => 'î',
                                    '&APM-' => 'ó',
                                    '&APE-' => 'ñ',
                                    '&AOE-' => 'á',
                                    '&APQ-' => 'ô',
                                    '&AMk-' => 'É',
                                    '&AOs-' => 'ë');

    /**
     * get local name
     *
     * @return string local name
     */
    public function getLocalName()
    {
        return self::decode($this->_localName);
    }

    /**
     * get global name
     *
     * @return string global name
     */
    public function getGlobalName()
    {
        return self::decode($this->_globalName);
    }

    protected static function decode($value){
        return str_replace(array_keys(self::$_decode), array_values(self::$_decode), $value);
    }
}

I don't what's the real encoding, so I couldn't made a generic method.

I hope I could help you, Bye

Comments

Bulk change of all issues last updated before 1st January 2010 as "Won't Fix".

Feel free to re-open and provide a patch if you want to fix this issue.