htmlentities doesn't convert apostrophe ’
Posted: Mon Jul 31, 2006 3:51 am
Hi all sorry for the banal question but i'm new to the charset question and i think that i need to get
a lot of knowledge about that argument.
My problem is that i use iso-8859-15 like charset into my webpage to show particular character like € and so on.
I have passed to htmlentities the string containing this charset but seem to doesn't work.
I have write a snipped of code to show the problem:
I hope that anybody can help me to understand what is the problem
Thanks to all in advance.
a lot of knowledge about that argument.
My problem is that i use iso-8859-15 like charset into my webpage to show particular character like € and so on.
I have passed to htmlentities the string containing this charset but seem to doesn't work.
I have write a snipped of code to show the problem:
Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="it" lang="it">
<head>
<title>::: [ Test special chars ] :::</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-15" />
</head>
<body>
<?php
$test = '’';
$test = htmlentities($test, ENT_COMPAT, 'ISO-8859-15');
echo $test;
echo '€';
?>
</body>
</html>Thanks to all in advance.