Hi!
I'm starting to pull my hair off with this troublesome issue.
To start with I must admit that I'm not 100% into how encodings work etc so I may see this from the wrong perspective.
However, I'm building a PHP script which handles incoming mails from my mobile phone.
The text coming in is in the form of an attachment and after some research I know that the charset is iso-10646-ucs-2
When I've fetched out that text in my script to $text it looks fine in the browser but if I check the source there's whitespaces between every character.
So what I've written as "this is a test" will become "t h i s i s a t e s t". That is, one whitespace extra after every single little letter.
I could manipulate this with a regex etc but there must be a simpler way I guess?
After some research I think what I want to do is to convert the text to another charset, and that one is iso-8859-1 I think. Or if I look in mail I've gotten from friends it seems to be us-ascii. I don't know!
However, noteworthy is:
* When I receive this mail in Outlook and open the attachment in Notepad the text looks just fine!
But when receieving it in PHP it looks like mentioned.
How do I fetch the text then?
First detirmining $pid then:
$text = imap_base64(imap_fetchbody($inbox, $id, $pid));
I'm thankful for all help!