Euro sign in HTML

caw picture caw · Sep 6, 2009 · Viewed 26.8k times · Source

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!

Answer

Konrad Rudolph picture Konrad Rudolph · Sep 6, 2009

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?