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

Current Transcoder class does not support all charsets. #237

Closed
wujku opened this issue Oct 11, 2017 · 5 comments
Closed

Current Transcoder class does not support all charsets. #237

wujku opened this issue Oct 11, 2017 · 5 comments
Labels

Comments

@wujku
Copy link
Contributor

wujku commented Oct 11, 2017

I have a problem with windows-1250 charset, mb_convert_encoding does not support it.
Previously, ddeober/transcoder package used iconv in case of mb_convert_encoding threw exception.
Can we restore dependency of ddeober/transcoder package and use Transcoder::decode method from it?

@wujku
Copy link
Contributor Author

wujku commented Oct 11, 2017

I use PhpMimeMailParser\Parser temporarily, but it need raw message.

try {
    $entity->setText($message->getBodyText());
} catch (Ddeboer\Imap\Exception\UnsupportedCharsetException $e) {
    $parser = new PhpMimeMailParser\Parser();
    $parsedMail = $parser->setText($message->getRawMessage());
    $entity->setText($parsedMail->getMessageBody('text'));
}

@Slamdunk
Copy link
Collaborator

Slamdunk commented Oct 11, 2017

ddeober/transcoder is not reliable because doesn't behave in a predictable way, doesn't support aliases and lacks a unified exception set. mb_string is much more flexible and reliable, but I understand it doesn't support all the charsets iconv can provide.

I already have a fix ready, it justneed tests: can you send me the raw message with windows-1250 charset, with every sensitive information deleted please?

@Slamdunk Slamdunk added the bug label Oct 11, 2017
@wujku
Copy link
Contributor Author

wujku commented Oct 11, 2017

@Slamdunk
Copy link
Collaborator

Closed by #238 thank you

@Slamdunk
Copy link
Collaborator

Release on 1.0.4.

@wujku Thank you very much for you feedbacks 👍

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

No branches or pull requests

2 participants