Add iconv extension to suggested dependencies

This commit is contained in:
Julien Falque 2017-04-27 19:06:39 +02:00
parent e9e4c79894
commit 13f17079ef
No known key found for this signature in database
GPG Key ID: 6B13BB4B40DBD0E9
2 changed files with 5 additions and 0 deletions

View File

@ -167,6 +167,9 @@ abstract class AbstractDumper implements DataDumperInterface, DumperInterface
*/
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;
}

View File

@ -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": {