Input to form => Á,
Data in webpage =>Á,
Data in DB => Ã
which isn't right it is suposed to be Á both on the web page and in the DB.
I think this has something to do whit charsets but I have been trying for over 7 ours just to fix this and have tried to search the web but I can't find anything about what this could be.
The function wich replaces Icelandic characters with HTML characters
Code: Select all
function replace_isl($text){
$letters = array('Á','á','Æ','æ','Ð','ð','É','é','Í','í','Ó','ó','Ö','ö','Ú','ú','Ý','ý');
$asic = array('Á','á','Æ','æ','Ð','ð','É','é','Í','í',
'Ó','ó','Ö','ö','Ú','ú','Ý','ý');
$output = str_replace($letters, $asic, $text);
echo substr_count($text,'æ');
return $output;
}
Code: Select all
$data = $form->exportValues();
$foo= $data['name'];
$foo = replace_isl($foo);
echo $foo; //returns Á not Á as it should