Command line character encoding from PHP's exec() -
I have a php exec
function and problems for a command line program in UTF-8 text I suspect that this character is due to encoding problems.
When I call locomotion
from the command line, I get: UTF-8
.
But when I do:
& lt ;? Php echo exec ('locale charmap'); ? & Gt;
I got
ANSI_X3.4-1968
How can I change it? It's not something I want to set up once - I'm working with different languages / encoding, so each call can be different to exec ()
But to know how to set it up in UTF-8
, it will be useful.
LANG = & lt; Language & gt; .UTF8
.
$ php -r "prefix command with echo exec ('LANG =' '.' 'En_US.UTF8 \" local magic'); "UTF-8 $ php -r" Echo exec ('LANG = \ "en_US.iso88591 \" locale charmap'); ISO-8859-1
You must have locale installed.
Comments
Post a Comment