Can we submit euro sign € in html form?

2.9k views Asked by At

I'm trying to submit '' (typed on input type=text) but I'm receiving "â?¬" instead.

Do we have any solution for this to make me receive correct '' symbol?

4

There are 4 answers

0
Devang Rathod On

TRY : insert inside textbox and submit, it will echo symbol

<form action="" method="post">
<input type="text" name="test" />
<input type="submit" value="go" name="submit"/>
</form>

PHP

<?php

if(isset($_POST['submit'])) {
    echo $_POST['test'];
    exit;
}

?>
0
Nigel B On

You could try using the HTML name i.e. &euro;

See this link for a full list of ASCII codes and HTML equivalents

2
Anders Lindahl On

You are receiving a as it is encoded in UTF-8, but you interpret it as a different encoding (possibly Windows-1252 or ISO-8859-1).

Judging by the characters you see (â?¬), the byte sequence 0xE2 0x82 0xAC match ISO-8859-1.

Look at the content-type header of the POST request, as this answer outline. It will indicate what encoding was used when submitting the form.

Edit: If you get a single ? when you switch to interpreting the form data as UTF-8, you probably have interpreted it correctly. The reason you do not see a nice could be because you look at the data with an ISO-8859-1 terminal instead of an ISO-8859-15 terminal (the former does not have an € sign defined).

Now is a good time to read Joels The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets (No Excuses!)

0
comb On

in my case i had <meta charset="utf-8" /> missing