UTF7-IMAP encoding problems
Hi there, at line 210 of file Connection.php this UTF8 conversion is giving me some problems reading an office365 server.
foreach ($mailboxesInfo as $mailboxInfo) { $name = \mb_convert_encoding(\str_replace($this->server, '', $mailboxInfo->name), 'UTF-8', 'UTF7-IMAP'); $this->mailboxNames[$name] = $mailboxInfo; }
It would be much better to do the conversion like this: $name=\mb_convert_encoding($cleanname, 'UTF8', mb_detect_encoding(\str_replace($this->server, '', $mailboxInfo->name)));
What exactly are the issues you have?
What exactly are the issues you have?
Office365 server is returning ASCII encoding, not UTF7, so the result of mb_convert_enconding() is empty.
As a result, you can't fetch the Mailboxes (because the script uses its name as identifier inside the array).
I figured out I copied/pasted the purposal too fast. $cleanname variable is the result of: $cleanname = str_replace($this->server, '', $mailboxInfo->name);
Then you do: $name=\mb_convert_encoding($cleanname, 'UTF8', mb_detect_encoding($cleanname));
Office365 server is returning ASCII encoding, not UTF7
That would be very weird and out of standards, but I'm not surprised.
May you post here the UTF8 encoded name of the mailbox you are using, so I can reconvert it into ASCII in the Test Suite and write a dedicated test?