Question

I am having an issue with the Euro currency sign HTML entity when viewing in GMail.

I am using € instead of € and this shows as a square box/bad character in GMail when using Firefox, whereas when I switch it to € it works.

It doesn't seem to affect Yahoo! email accounts, only GMail from what I have seen so far.

Some research leads me to believe that € is less widely supported than € and I should switch, however i'd ike to know which should be used for conformity and support?

Était-ce utile?

La solution

It's probably a character encoding issue. € simply means character number 128 from the ISO 10646 codepage, which is technically undefined. For historical reasons, most browsers map these characters according to windows-1252, but this is anything but standardized behavior. €, however, unambiguously maps to the euro currency sign, regardless of character encoding. There is a third option: use the unicode code point for the euro sign (€). This, too, should work in any browser. And finally, you can put a literal euro sign into the HTML, but if you do, you need to make sure you set the correct encoding in your content-type headers, so that the receiving user agent can make sense of it.

Autres conseils

The code € corresponds to the ISO-10646 character \u0080, which is a non-printable control character. Despite this fact some browsers may interpret it as the euro character because in one of the text encodings used by Microsoft the byte 80h is used for euro, but it is not standard.

If you want a portable way to encode the euro sign use €, €, or €.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top