note 89071 added to function.imap-savebody
| From: | janus at forty-seven dot info | Date: | Fri, 20 Feb 2009 09:40:53 +0000 |
| Subject: | note 89071 added to function.imap-savebody | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-150884@lists.php.net to get a copy of this message | ||
It seems that imap_savebody saves attachments with special characters above ascii 127 as quoted
printable.
But if you need it in utf8, you may use the imap_qprint function after the attachment is saved:
<?php
$tFile = "/path/to/attachment";
$tFileOutput="";
$tFileHandle = fopen($tFile, "r");
//get the content of the file into a string
while(!feof($tFileHandle))
$tFileOutput = $tFileOutput . fgets($tFileHandle, 4096);
fclose ($tFileHandle);
$tFileHandle = fopen($tFile, "w");
//write the new 8Bit string to the file
fwrite($tFileHandle, imap_qprint($tFileOutput));
fclose ($tFileHandle);
?>
----
Server IP: 217.13.201.10
Probable Submitter: 194.94.251.16
----
Manual Page -- http://www.php.net/manual/en/function.imap-savebody.php
Edit -- https://master.php.net/note/edit/89071
Del: integrated -- https://master.php.net/note/delete/89071/integrated
Del: useless -- https://master.php.net/note/delete/89071/useless
Del: bad code -- https://master.php.net/note/delete/89071/bad+code
Del: spam -- https://master.php.net/note/delete/89071/spam
Del: non-english -- https://master.php.net/note/delete/89071/non-english
Del: in docs -- https://master.php.net/note/delete/89071/in+docs
Del: other reasons-- https://master.php.net/note/delete/89071
Reject -- https://master.php.net/note/reject/89071
Search -- https://master.php.net/manage/user-notes.php