Skip to content

Commit

Permalink
Add iconv extension to suggested dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
julienfalque committed Apr 28, 2017
1 parent e9e4c79 commit 13f1707
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Symfony/Component/VarDumper/Dumper/AbstractDumper.php
Expand Up @@ -167,6 +167,9 @@ protected function echoLine($line, $depth, $indentPad)
*/
protected function utf8Encode($s)
{
if (!function_exists('iconv')) {
throw new \RuntimeException('Unable to convert a non-UTF-8 string to UTF-8: required function iconv() does not exist. You should install ext-iconv or symfony/polyfill-iconv.');
}
if (false !== $c = @iconv($this->charset, 'UTF-8', $s)) {
return $c;
}
Expand Down
2 changes: 2 additions & 0 deletions src/Symfony/Component/VarDumper/composer.json
Expand Up @@ -20,12 +20,14 @@
"symfony/polyfill-mbstring": "~1.0"
},
"require-dev": {
"ext-iconv": "*",
"twig/twig": "~1.20|~2.0"
},
"conflict": {
"phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0"
},
"suggest": {
"ext-iconv": "To convert non-UTF-8 strings to UTF-8 (or symfony/polyfill-iconv in case ext-iconv cannot be used).",
"ext-symfony_debug": ""
},
"autoload": {
Expand Down

0 comments on commit 13f1707

Please sign in to comment.