Wiki source for HtmlUnicode
===X/HTML & Unicode===
YES - you can display unicode characters even if apache is using ISO-8859-1 encoding and your HTML pages are using ISO-8859-1 encoding !
Here's how
%%
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
</head>
<body>
<pre>
<?
$str = "ab\xE2\x86\x91\xE2\x86\x93" ;
echo $str ."\n" ;
echo "\n" ;
echo htmlentities($str) ."\n" ;
echo htmlspecialchars(htmlentities($str)) ."\n" ;
echo "\n" ;
echo htmlentities($str,ENT_QUOTES,"UTF-8") ."\n" ;
echo htmlspecialchars(htmlentities($str,ENT_QUOTES,"UTF-8")) ."\n" ;
echo "\n" ;
echo urlencode($str) ."\n" ;
echo "\n" ;
?>
</pre>
</body>
</html>
%%
Should display
ab↑↓
ab↑↓
ab & acirc ; & acirc ;
ab↑↓
ab & # 8593 ; & # 8595 ;
ab & uarr ; & darr ;
ab%E2%86%91%E2%86%93
YES - you can display unicode characters even if apache is using ISO-8859-1 encoding and your HTML pages are using ISO-8859-1 encoding !
Here's how
%%
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
</head>
<body>
<pre>
<?
$str = "ab\xE2\x86\x91\xE2\x86\x93" ;
echo $str ."\n" ;
echo "\n" ;
echo htmlentities($str) ."\n" ;
echo htmlspecialchars(htmlentities($str)) ."\n" ;
echo "\n" ;
echo htmlentities($str,ENT_QUOTES,"UTF-8") ."\n" ;
echo htmlspecialchars(htmlentities($str,ENT_QUOTES,"UTF-8")) ."\n" ;
echo "\n" ;
echo urlencode($str) ."\n" ;
echo "\n" ;
?>
</pre>
</body>
</html>
%%
Should display
ab↑↓
ab↑↓
ab & acirc ; & acirc ;
ab↑↓
ab & # 8593 ; & # 8595 ;
ab & uarr ; & darr ;
ab%E2%86%91%E2%86%93