Closed msbit closed 3 years ago
@msbit Guessing the Craft files on your filesystem are set to utf-16be
for their character encoding?
@angrybrad not as far as I can tell; from the stacktrace the value is hardcoded:
vendor/twig/twig/src/Extension/EscaperExtension.php:286: $char = twig_convert_encoding($char, 'UTF-16BE', 'UTF-8');
Looks like the Twig folks fixed this back in 2.14.0: https://github.com/twigphp/Twig/pull/3397/files
Looks like the Twig folks fixed this back in 2.14.0: https://github.com/twigphp/Twig/pull/3397/files
I love you angrybrad!
Ps. This is platonic love!
Description
Setting up a new server from scratch (without the PHP
iconv
extension enabled), I receive the following error when accessing/admin/login
:iconv(): Wrong charset, conversion from
utf-8' toutf-16be' is not allowed
The issue seems to be that
twig/twig
ends up callingiconv
to convert fromutf-8
toutf-16be
, but the polyfill provided bysymfony/polyfill-iconv
doesn't have a conversion table for this.Once I've enabled the
iconv
extension, the issue goes away.Steps to reproduce
iconv
extension disabled/admin/login
Full stacktrace
Additional info
Craft version:
PHP version:
Database driver & version:
Plugins & versions: