I'm having an issue when trying to save strings with accents.
Our online system is used by clients from different countries, so some of our clients use accents.
When doing a request to get the value to save like this
$value = trim(strip_tags(htmlspecialchars($_REQUEST['value'], ENT_QUOTES, 'UTF-8')));
It saves the value in this way
Gé
If instead of htmlspecialchars I use htmlentities it saves like this
géî
The correct string I'm trying to save is
Gé
I need this to be saved correctly so it can be displayed correctly on screens and reports.
Our db uses UTF-16 (MS SQL Server), and I'm declaring the meta tags to use UTF-8 on the page like this
<meta charset='utf-8'>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'>
This is how the connection looks:
$link = sqlsrv_connect($dbserver, array(
'Database'=>$database,
'UID' => $uid,
'PWD' => $pwd,
'CharacterSet' => 'UTF-8'
));