I have a problem with my script. It reads mails from stdin and do whatever it's needed. My script works like a charm for some mail clients like thunderbird or outlook.com. The main problem is that it doesn't work with the program 'mail' from apple (that is very used in my enterprise).
For some reason the text readed from mail it's not codificated. For example:
Respuesta 5 desde Mail
El 17/03/2015, a = las 13:13, app@******.es = escribi=F3:
--=3D=3D--
RESPONDER POR ENCIMA DE ESTA L=CDNEA
Comunicaci=F3n
C=F3digo: PRB03154
Nombre del grupo: MYSTICA
Prueba de = comunicaciones a trav=E9s de mails
Comunicaci=F3n enviada por **** (Departamento de = ****)
As you can see there are some =F3 that are the equivalents to char ó and there are multiples single '=' that, I assume, comes from =\n
I've tried codes like:
echo utf8_encode($texto);
or
mb_internal_encoding('UTF-8');
echo str_replace("_"," ", mb_decode_mimeheader($texto));
or
echo iconv(mb_detect_encoding($texto, mb_detect_order(), true), "UTF-8", $texto);
Is there a way to convert this text to something more readable?
Thanks