Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

NikkiLoveGod's avatar

Artisan Tinker with UTF

Hi,

I'm from Finland I need to have access to letters like ä ö å etc - but my application's artisan tinker will not accept such letters at all - it wont input or output anything when trying to input them. It will even ignore them in a paste.

How can I have tinker accept my unicode characters? My Vagrant is otherwise working fine with them.

0 likes
2 replies
funkjedi's avatar

I tried on a couple of my servers with varying results. In some cases Boris would crash in others the correct value was assigned but the characters wouldn't display correctly (or at all) while accepting input.

> ./artisan tinker
[1] > '';
// 'ä'
[2] > 

I think this actually an issue with UTF-8 support in the PHP readline extension. I get the exact same results when using the built-in interactive shell php -a.

> php -a
Interactive mode enabled

php > print '' . PHP_EOL;
ä
php > 
NikkiLoveGod's avatar

That's actually very interesting, thanks for spending a little time!

I ended up using a little detour which is obviously not as handy, but I just made a temporary /dev route and I did my tinkering in a closure inside the routes file.

Please or to participate in this conversation.