Hi there,
after several and several tests, I figured out that dot:
- htmlentities() function remove characters like "à","è",etc when you specify a flag and a charset
- htmlentities() function DOES NOT remove characters like those above when you DO NOT specify anything
So, let's assume that..
<?php
$str = "Hèèèllooo";
$res_1 = htmlentities($str, ENT_QUOTES, "UTF-8");
$res_2 = htmlentities($str);
echo var_dump($res_1); echo var_dump($res_2); ?>
I used this for a textarea content for comments. Anyway, note that using the "$res_2" form the function will leave unconverted single/double quotes. At this point you should use str_replace() function to perform the characters but be careful because..
<?php
$str = "'Hèèèllooo'";
$res_2 = str_replace("'","'",$str);
$res_2 = htmlentities($str);
echo var_dump($res_2); $res_3 = htmlentities($str);
$res_3 = str_replace("'","'",$res_3);
echo var_dump($res_3); ?>
Hope it will helps you.
Regards,
W.D.