2

I read e-mails via php imap, and I can convert the header data to utf8.

But some email body is in ascii / 7bit, and I can't convert it.

No change by iconv($row['encode'],'utf-8' ,$row['text']); or mb_convert_encoding($row['text'], $row['encode'], "UTF-8"); and imap_utf8($row['text']); fails.

Do you have any idea to get off the 3D=3D=3D=3D=3D=3D=3D=3D and others from the mail body?

Eleanor
  • 358
  • 5
  • 24
  • What others? I believe `3D` is actually hex, for the ascii character `=` – l'L'l Feb 17 '15 at 10:31
  • `=C3=ADt=C3=A9 =C3=A9 =C3=B6rt=C3=A9nt, mi=C3=B3ta utolj=C3=A1ra` is there any decoding method to change these `=C3=B6` to understandabe letters? – Eleanor Feb 17 '15 at 10:37
  • That's UTF-8 encoded as quoted-printable. Any half-decent MIME library should handle these transparently for you. – tripleee Feb 17 '15 at 10:39
  • Other posibility to convert encodings [here](http://stackoverflow.com/a/33744256/4558483). – albertoiNET Nov 16 '15 at 20:48

1 Answers1

2

Have a look at quoted_printable_decode, that should help.

MBaas
  • 7,248
  • 6
  • 44
  • 61
  • 2
    That's still what you are going to need. You are probably invoking it incorrectly. You pass it the MIME part which is quoted-printable encoded, not the entire message. – tripleee Feb 17 '15 at 10:39
  • What exactly do you mean with "fails"? Are you getting errors or unecpected results (pls. Update Q with latest code and show output...€ – MBaas Feb 17 '15 at 14:06