I'm new to PHP. When I try htmlspecialchars() with ENT_HTML5 flag it works, but all non-English words are removed. I tried:
<?php
$sometext = $_GET['query'];
$sometext = htmlspecialchars($sometext, ENT_HTML5, 'UTF-8');
echo $sometext;
?>
For example, I tried with query "Hello world, Привет мир!" (English, Russian). But it returned me "Hello world, !". I don't have access to a php.ini. Maybe there is a problem? How can I solve this problem?
Thank you, @deceze, I found the solution:
<?php
$sometext = $_GET['query'];
$sometext = htmlspecialchars($sometext, ENT_HTML5, 'Windows-1251');
echo $sometext;
?>