php-imap-client
php-imap-client copied to clipboard
convert_UTF8 error
Feature request or bug
If a bug, what did you expect to happen?
If a bug, what happened?
If a bug, list steps to reproduce bugs.
If a bug, did you do these steps?
[] Download and use the lastest stable version [] See if the issue has already been reported [] Debug
If a feature request, what do you want to be added or changed?
If a feature request, is this feature already in a pull request?
If a feature request, do you know anyone who can help?
Side notes(Read then del this chunk)
Please use pastebin for var_dumps. Not screenies or paste blobs!
Be descriptive!
Please fill out this entire form!
For someone having the same issues with the utf-8 decode for Subject and Content, you can modify the class to following:
`/** * convert to utf8 if necessary. * * @return true or false * @param $string utf8 encoded string */ protected function convertToUtf8($string, $charset = 'utf-8') { $newString = ''; $elements = imap_mime_header_decode($string);
for($i = 0; $i < count($elements); $i++) {
if($elements[$i]->charset == 'default') {
$elements[$i]->charset = 'iso-8859-3';
$elements[$i]->text = quoted_printable_decode($elements[$i]->text);
}
$newString .= $this->convertStringEncoding($elements[$i]->text, $elements[$i]->charset, $charset);
}
return $newString;
}`
That has fixed the issues for special characters and quoted encoded content.