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

Should iconv be a requirement? #115

Closed
chrissound opened this issue Apr 10, 2016 · 7 comments
Closed

Should iconv be a requirement? #115

chrissound opened this issue Apr 10, 2016 · 7 comments
Labels
Milestone

Comments

@chrissound
Copy link

I've just run into the below error:

PHP Fatal error:  Uncaught Ddeboer\Transcoder\Exception\ExtensionMissingException: iconv in /home/chris/Projects/Dashboard/vendor/ddeboer/transcoder/src/IconvTranscoder.php:16
Stack trace:
#0 /home/chris/Projects/Dashboard/vendor/ddeboer/transcoder/src/Transcoder.php(62): Ddeboer\Transcoder\IconvTranscoder->__construct('UTF-8')
#1 /home/chris/Projects/Dashboard/vendor/ddeboer/imap/src/Parameters.php(41): Ddeboer\Transcoder\Transcoder::create()
#2 /home/chris/Projects/Dashboard/vendor/ddeboer/imap/src/Parameters.php(20): Ddeboer\Imap\Parameters->decode('multipart_alter...')
#3 /home/chris/Projects/Dashboard/vendor/ddeboer/imap/src/Message/Part.php(236): Ddeboer\Imap\Parameters->add(Array)
#4 /home/chris/Projects/Dashboard/vendor/ddeboer/imap/src/Message.php(329): Ddeboer\Imap\Message\Part->parseStructure(Object(stdClass))
#5 /home/chris/Projects/Dashboard/vendor/ddeboer/imap/src/Message.php(34): Ddeboer\Imap\Message->loadStructure()
#6 /home/chris/Projects/Dashboard/vendor/ddeboer/imap/src/MessageIterator.php(29): Ddeboer\Imap\ in /home/chris/Projects/Dashboard/vendor/ddeboer/transcoder/src/IconvTranscoder.php on line 16
<?php
require "vendor/autoload.php";

use Ddeboer\Imap\Server;

$server = new Server('abc', 993);

$connection = $server->authenticate('abcxyz', 'abcxyz');

$inbox = $connection->getMailbox("INBOX");
$messages = $inbox->getMessages();

foreach ($messages as $message){
    echo $message->getSubject() . PHP_EOL;
}
@holdmann
Copy link

Obviously, yep :)

Transcoder requires either mb or iconv.

@ddeboer
Copy link
Owner

ddeboer commented Apr 12, 2016

Indeed. @chrissound Does that answer your question?

@mate01988
Copy link

How to solve this error?

@chrissound
Copy link
Author

Perhaps we could add these as dependencies to the composer.json? I see iconv is a dependency for require-dev only?

@mate01988 You need to install or enable the 'iconv' PHP extension.

@Slamdunk
Copy link
Collaborator

If we'll face the need to mark iconv as mandatory, it will be moved to required on this library or on its dependencies.

But first we need to stand strong charset test cases up.

@ddeboer
Copy link
Owner

ddeboer commented Sep 22, 2017

Transcoding is not a responsibility of this library but of ddeboer/imap (a thin wrapper around mb/iconv) instead. Tests for transcoding should be added to that library.

Slamdunk added a commit that referenced this issue Sep 27, 2017
Message charset: mb_convert_encoding + aliases
Closes #78 #85 #115 #132 #136 #158 #165 #171 #174 #176
@Slamdunk Slamdunk added this to the 1.0 milestone Sep 27, 2017
@Slamdunk
Copy link
Collaborator

Hi, the issue has been fixed in #196 thank you for your feedback.

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

5 participants