1

I use imap_fetchbody to download email from my personal email to a MYSQL DB and when i use with special characters, like accents, in my DB save n? instead of nÂș for example

Anyone can help me with this problem?

Example:

$data = imap_fetchbody($mbox,$mid,'0');

Best Regards.

Ferrete
  • 55
  • 8

2 Answers2

0

This sounds more like a MySQL issue than an IMAP issue.

Try encoding the data as UTF-8. You may also need to specify the character set used by the tables in your database.

Community
  • 1
  • 1
Gigi
  • 28,163
  • 29
  • 106
  • 188
0

try to convert like this $data = imap_qprint(imap_fetchbody($mbox,$mid,'0')); before the db insertion.

http://php.net/manual/en/function.imap-qprint.php

Arslanbekov Denis
  • 1,674
  • 12
  • 26
fo-lefak
  • 29
  • 3