2

I have a question regarding the POST values I get back when I post a HTML form like this:

<form action="" method="POST">
    <input type="text" name="test">
    <input type="submit">
</form>

If I type in jöachi@æøåèÆ in the input field and do a var dump on the $_POST value, I get this:

array (size=1)
  'test' => string 'jöachi@æøå&#232;Æ' (length=17)

In the result you can see that the è sign have been replaced with the ISO Latin-1 code &#232;

How can I make it so that it doesn't do that?

The encoding in my page is ISO-8859-10, and I tried to change it to be UTF-8, but with no luck.

I also thought it might be something to do with magic_quotes in my apache, but that isn't enabled.

Any help appreciated

Joachims
  • 48
  • 4

2 Answers2

1

Using UTF-8 would be bad in any case for you? If not, try explicitly saying that you are using UTF-8 with meta:

<meta charset="utf-8" />

It will probably solve your problem.

In all my web applications I use UTF-8 and I always make sure all the communications are made in that way, even all the database collations.

Anyway, try to force your form to submit in UTF-8 everytime too.

<form action="" method="POST" accept-charset="UTF-8">
Ivo Pereira
  • 3,410
  • 1
  • 19
  • 24
  • if you set `ini_set('default_charset', 'UTF-8')` at the top of the script, then you can omit `` – Yang Sep 24 '13 at 15:54
0

This is character set issue.

use this line before </head> tag.

<meta http-equiv="content-type" content="text/html; charset=utf-8" />

If you are saving data in MySql then first change mysql collation to UTF-8 general ci

and add these two line where you are saving the data.

mysql_query( "SET NAMES 'utf8'" );
mysql_query( "SET CHARACTER_SET 'utf8'" );
Satyam Saxena
  • 581
  • 2
  • 10