2

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?

2
  • Does &#0128 work in firefox when used in other contexts than GMail? Commented May 4, 2012 at 16:51
  • @ChristoferEliasson Yes, I have just tested it with a simple php script that echos out echo '€ and it does work.
    – crmpicco
    Commented May 4, 2012 at 16:53

2 Answers 2

5

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 €.

0
4

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.

3
  • From your comment it is clear that there are issues with making blanket changes like this. Changing this value in my database will affect many parts of the system, so, understandibly, I am wary. It may be misunderstanding that is the reason € is in the database, so from what you are saying changing to € is the recommended course of action.
    – crmpicco
    Commented May 4, 2012 at 16:57
  • 1
    € always means character 128 from ISO 10646, not from the currently selected code page.
    – Joni
    Commented May 4, 2012 at 17:03
  • By the specifications, &#n; means character with code number n in ISO 10646 and Unicode, independently of character encoding. This € is technically undefined, because character 128 is a control character in Unicode and forbidden in HTML. In practice, browsers traditionally interpret such code numbers according to windows-1252, yielding the euro sign in this case. It is surprising if this does not happen in Gmail, but anyway, use a correct reference like €. Commented May 4, 2012 at 17:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.