9

I'm tying extract some content of some equal emails with php but I can't.

With that:

$body = imap_body($imap_o, $email_n);

I get:

Pour = le r=E9cup=E9rer, il suffit de le t=E9l=E9charger, de le r=E9ceptionner puis de    l=92ouvrir.=Une f= ois votre traduction termin=E9e, n=92oubliez pas de sauvegarder vos paires de langues et d=92effectuer une v=E9rification g=E9n=E9rale (statuts des segments, b= alises, nombres, espaces, majuscules, etc.).Ensui= te, cliquez sur =AB=A0Terminer et livrer=A0=BB.Voici le r=E9capitulatif du projet=A0:

but there are lot of =* I know that =20 its and space, but here there are others that I don't know what mean.

If I add quoted_printable_decode():

$body = quoted_printable_decode($body);

I get:

Pour le r�cup�rer, il suffit de le t�l�charger, de le r�ceptionner puis de l�ouvrir. Une fois votre traduction termin�e, n�oubliez pas de sauvegarder vos paires de langues et d�effectuer une v�rification g�n�rale (statuts des segments, balises, nombres, espaces, majuscules, etc.). Ensuite, cliquez sur ��Terminer et livrer��. Voici le r�capitulatif du projet�:

I added imap_qprint() and utf8_decode and nothing improve...

Before decode that messages I need to send a "clean" copy of those, without some information, and if I can get those on plain format it will help me to do it much faster and easier.

And If i need to delete some words of the body how can I do?

BenMorel
  • 34,448
  • 50
  • 182
  • 322
ganlub
  • 149
  • 1
  • 2
  • 12

3 Answers3

13

Try

$body = utf8_encode(quoted_printable_decode($body));
Musa
  • 96,336
  • 17
  • 118
  • 137
  • Nice, it works. I tried it after...but now works. And what about convert it to plaint text, without HTML? or some way that allow me to remove some lines or words without loose performance? Thank you! EDIT: Well, better without loose HTML fromat, because I've to resend it. – ganlub Jun 29 '13 at 18:40
0

and maybe you could set the file encoding. in dw, ctrl+j, title encoding settings, utf8 without bom. or notepad2, file > encoding > utf8

Ahmet Mehmet
  • 288
  • 2
  • 10
0

You can't use utf8_encode though, since you would need to remove utf8 in order for it to be properly used.

cigien
  • 57,834
  • 11
  • 73
  • 112
  • This is meant to be a comment on https://stackoverflow.com/a/17383384/7733418 Isn't it? – Yunnosch Jun 29 '22 at 21:06
  • user18641276 , please [edit] to turn this into an answer to the question at the top of this page, according to [answer]. This currently gives the impression of being a comment to one of the other answers. If it is meant to be, this should be deleted. – Yunnosch Jul 07 '22 at 06:40
  • You can also [edit] to make this an answer which is based on the other answer, or contrasts to it, by pointing out a problem and at least outlining the solution for it. – Yunnosch Jul 07 '22 at 07:01