I need to address UTF-8 filenames with the php exec command. The problem is that the php exec
command does not seem to understand utf-8. I use something like th
To answer my own question - i found the following solution:
setting the locale environment variable with PHP
$locale='de_DE.UTF-8';
setlocale(LC_ALL,$locale);
putenv('LC_ALL='.$locale);
echo exec('locale charmap');
This sets to / returns UTF-8
. So i'm able to pass special characters and umlauts to linux shell commands.