=? ISO-8859-1 in the subject line

I get unread letters that I have in my GMail account through PHP and its imap_open method

When I get items using the imap_fetch_overview method, I get several of these topics:

=?ISO-8859-1?Q?Informaci=F3n_Apartamento_a_la_Venta?= =?ISO-8859-1?Q?_en_Benasque(Demandas:_0442_______)?=

Unreadable, I think, because of its character encoding.

What to do to make it readable?

+4
source share
2 answers

To get a string in UTF-8, do:

$or = '=?ISO-8859-1?Q?Informaci=F3n_Apartamento_a_la_Venta?= =?ISO-8859-1?Q?_en_Benasque(Demandas:_0442_______)?=';
mb_internal_encoding('UTF-8');
$v = str_replace("_"," ", mb_decode_mimeheader($or));

which gives:

InformaciΓ³n Apartamento a la Venta en Benasque (Demandas: 0442)

You can convert according to ISO-8859-1 if you want.

+9
source
$or = '=?ISO-8859-1?Q?Informaci=F3n_Apartamento_a_la_Venta?= =?ISO-8859-1?Q?_en_Benasque(Demandas:_0442_______)?=';
mb_internal_encoding('UTF-8');
$v = str_replace("_"," ", mb_decode_mimeheader($or));

it works for me (thanks artefacto)

-1
source

All Articles