Imap, strange characters

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
enitrauw
Forum Newbie
Posts: 1
Joined: Wed Sep 15, 2010 7:42 am

Imap, strange characters

Post by enitrauw »

Hi all,

I'm stuck with something, it's about charcters like ÄÖÜ, with an accent.

I've written a simple php code that shows a certain message, with use of imap. This is the code (without password :)

Code: Select all

    $imap = imap_open("{imap.gmail.com:993/imap/ssl}INBOX", "janpietklaas@gmail.com", "XXX");
    $thismsg = imap_body($imap, 32144);
    echo $thismsg;
A message with id 32144 is shown, works fine, text is shown.

what's the point:
When reading the message in gmail, the text is correct: ÄÖÜ (that's the only text in the message, so fine).

When I open the message with the php script, the shown text is:
=C3=84=C3=96=C3=9C

utf8_decode() and utf8_encode() change nothing, same output. With use of quoted_printable_decode() the output is: ÄÖÜ

Does anyone can tell me what to do to get the right output: ÄÖÜ
Many thanks
Post Reply