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

mb_convert_encoding(): Illegal character encoding specified #94

Closed
dereuromark opened this issue Dec 3, 2018 · 8 comments
Closed

mb_convert_encoding(): Illegal character encoding specified #94

dereuromark opened this issue Dec 3, 2018 · 8 comments

Comments

@dereuromark
Copy link
Member

When trying to use TwigView rendering, I got

mb_convert_encoding(): Illegal character encoding specified

in vendor/twig/twig/lib/Twig/Extension/Core.php:1137

Any idea what this is? It is a basic ascii template with simple variables.

	$data = [
		'name' => 'Foo',
		'namespace' => 'foo',
		'plugin' => 'cakephp-foo',
	];

	$this->renderer->set($data);

	$content = $this->renderer->generate('foo');
@dereuromark
Copy link
Member Author

Ah, it looks like it pulls php7.1 already, even though for me I need the 5.6 one still:

echo twig_escape_filter($this->env, ($context["plugin"] ?? null), "html", null, true);

Is that it maybe? Any idea how to restrict?

@dereuromark
Copy link
Member Author

The acutal issue is this though:

'charset' => strtolower(Configure::read('App.encoding')),

You should probably use readOrFail() to avoid it not being set (as in my case via test harness).

@WyriHaximus
Copy link
Collaborator

Sorry for the late response my github box got swamped due to automated dependency bumping. So are you using this for CakePHP 3 or the upcoming for 4? (Should fix it in both tbh.)

@dereuromark
Copy link
Member Author

cake3

@WyriHaximus
Copy link
Collaborator

Cheers, looking into it tonight

@dereuromark
Copy link
Member Author

You can easily reproduce it by commenting out 'encoding' => 'utf-8',
https://github.com/dereuromark/cakephp-dto/blob/master/tests/bootstrap.php#L32
and running the tests on that plugin.

@WyriHaximus
Copy link
Collaborator

@dereuromark sorry for the delay #101 is up to fix this

@WyriHaximus
Copy link
Collaborator

Tagged 4.3.8 with #101

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

No branches or pull requests

2 participants