Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

convert_UTF8 error #251

Open
kavs opened this issue Apr 3, 2020 · 1 comment
Open

convert_UTF8 error #251

kavs opened this issue Apr 3, 2020 · 1 comment

Comments

@kavs
Copy link

kavs commented Apr 3, 2020

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!

@JAKgit
Copy link

JAKgit commented May 27, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants