Reply to Re: Strange behaviour of shell_exec

Your name:

Reply:


Posted by J.O. Aho on 09/28/11 11:42

Don wrote:
> Hi,
>
> I have a problem with the special characters on the function shell_exec
> (under Linux Debian with php 4.3.10-16):
>
> $msg = '"'."Léà t'es où?".'"';
>
> $output = shell_exec('java myClass'.' '.$msg);
>
> All the special characters in $msg like é or à are turned into the
> strange characters with shell_exec function. Whereas under the shell if
> I type :
>
> java myClass "Léà t'es où?"
>
> It works fine with all the special characters.
>
> Is there a way to walk arround this problem?
>
> Thank you in avance

You can try to put a slash infront of all special characters,

$msg = "\"L\é\à t\'es o\ù?\"";


The trouble can also be that your PHP works with unicode (utf-8) while your
system is set to use an iso-8859-X character setup.


//Aho

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация