This is driving me crazy:
I have a simple form and I'm trying to post back a single character and test it's ASCII code. Although it works for standard characters, special characters such as Ø give an incorrect code. The code should be ASCII 216. I'm getting ASCII 239.
I tried changing my character set from ISO-8859-1 to UTF-8, but it makes no difference. I should point out that I am on an "https" secure server. Works okay on a standard domain. What's happening?
Any ideas?
I have a simple form and I'm trying to post back a single character and test it's ASCII code. Although it works for standard characters, special characters such as Ø give an incorrect code. The code should be ASCII 216. I'm getting ASCII 239.
I tried changing my character set from ISO-8859-1 to UTF-8, but it makes no difference. I should point out that I am on an "https" secure server. Works okay on a standard domain. What's happening?
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 transitional//EN">
<html>
<head>
<title>Test</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<?php
$a = $_POST['t'];
echo "The Character posted is: " . $a . "\r\nThe Character code is: " . ord($a) . "\r\nI am expecting ASCII Code 216";
?>
<form method="post" action="">
<input type="text" name="t" value="Ø">
<input type="submit" value="submit">
</form>
</body>
</html>
Any ideas?