Everything is in the question : I have a Php script that is a UTF-8 file. In this script I want to do this :
echo \"âêïû\\n\";
?>
Try this another one. It's working with Russian encoding, I hope it will work with French:
class ConsoleHelper
{
/**
* @var boolean
*/
private static $isEncodingSet = false;
/**
* @param string $message
* @return string
*/
public static function encodeMessage($message)
{
$isWindows = (DIRECTORY_SEPARATOR == '\\');
if ($isWindows) {
if ( ! self::$isEncodingSet) {
shell_exec('chcp 866');
self::$isEncodingSet = true;
}
$message = iconv('utf-8', 'cp866', $message);
}
return $message;
}
}