I have a Java app that I'm calling thru PHP exec. The Java shows the middot on the command line : "·"
But when the code is called from PHP in a utf-8 html page I Have a "?" instead of the "·".
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<form method="post" action="essai2.php">
<input type="text" name="texte" />
<input type="submit" value="Valider" />
</form>
<?php
echo "input text : ".$_POST['texte'];
exec("/usr/bin/java -jar runner.jar ".$_POST['texte'], $variable);
echo "<br>output text : ".$variable[0];
?>
</body>
</html>
Any clue ? (I tried htmlentities, htmlspecialchars. And text file on command line is utf-8)
To give some more grasp to the issue : on command line I do
java -jar runner.jar "le agriculteur est mort"
I get
[le·la, agriculteur·trice, est, mort]
while on webserver I get
[le?la, agriculteur??trice, est, mort]
the hex code of all this (following Rick James comment) is :
5b6c653f6c612c206167726963756c746575723f3f74726963652c206573742c206d6f72745d
hope it helps