I'm having some problems with encoding in one of my applications. I'm therefore trying to understand a few aspects of the problem, by working with some small examples.
Code: Select all
<?php
header("content-type: text/html;charset=ISO-8859-1");
?>
<html>
<head>
<title>Test</title>
</head>
<body>
<form action="encoding.php" method="post">
<input name="input">
<input type="submit">
</form>
Value entered: <?php echo $_POST["input"]; ?>
<br><br>
</body>
</html>
Why is this? Are PHP forms always sent as UTF-8 ? Even if this is the case, the fact that the character entered is displayed correctly in the HTML page is a surprise - I would expect it to display a question mark.
Please enlighten me - thanks :-)