Re: shell_exec, how to make utf8????
If it's the locale that's messing it up, then what TheMan suggested should fix it. But if that doesn't, there's a couple things I can think of.
This might go without saying, but make sure that the output will be interpreted as UTF-8:
PHP Code:
header('Content-Type: text/html; charset=UTF-8');
If it's still messing up, then provided that the echo command modifies it in the same way, and provided that you can regularly output the hostname with no change, this might work:
PHP Code:
$host = 'www.västtrafik.se';
$search = substr(shell_exec("echo $host"), 0, -1);
$output = shell_exec("ping $host");
$output = str_ireplace($search, $host, $output);
"But you have access to the greatest source of knowledge in the universe."
"Well I do talk to myself sometimes, yes."
"I'm back, and I'm bad! Obviously within certain, sensible, preset parameters"