Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Euro sign in HTML

The euro (€) is the official currency in 22 European states.

In HTML there are different possibilities to display the sign €:

  • €
  • €
  • €

Which one would you use in HTML? I think no representation is supported in all browsers. It's a pity that there is no standard way to display the sign.

Can you recommend one of the representations? What are the differences? Which ist supported best?

I hope you can help me. Thank you very much in advance!

like image 258
caw Avatar asked Sep 06 '09 14:09

caw


1 Answers

Which one would you use in HTML?

None of them. Use an appropriate encoding (i.e.: UTF-8 or another Unicode transform) and use the charcter directly. Do not use HTML entities if at all avoidable, since they’ve got no advantage over use of a proper encoding.

Also, this is wrong:

It's a pity that there is no standard way to display the sign.

There is, and it’s the way I’ve described. Literally every browser, down to and including MSIE 5 will display Unicode characters correctly if the chosen fond supports the glyph.

The only valid reason to not use Unicode characters and instead fall back to entities might be projects that use legacy software which doesn’t support Unicode well. But that should never happen, right?

like image 71
Konrad Rudolph Avatar answered Oct 17 '22 08:10

Konrad Rudolph