tags:

views:

120

answers:

3
+3  Q: 

HTML code for INR

+5  A: 

The indian rupee sign is pretty new (introduced this July if I read it correctly) and doesn't even have a Unicode position yet, much less a HTML entity.

Even when it gets a Unicode position, it will probably still take years until it can be reliably used on a web page, because the client computers' Fonts will need to be updated accordingly. (I could imagine a font-face workaround with a custom font, though.)

Wikipedia uses an image file to display the symbol. It's far from good, but it may be the best workaround at the moment.

The generic rupee sign has three Unicode characters. See here.

Pekka
+1  A: 

No! You should avoid using HTML entities.

Instead of using HTML entities for symbols you should just put those symbols directly into your text and correctly encode your document.

  • Instead of using £ you should use the character £.
  • For rupee there is no Unicode character. You can use a PNG file instead rupee. Alternatively you can use the unicode character रू which is currently the most commonly used single character for rupee. Other alternatives are using INR, Rs. or rupees.

When the new Unicode symbol for the Indian Rupee is introduced then could use that instead (but note that it will be a while before all browsers support it).

Mark Byers
Note that the Indian rupee has a distinct symbol by now, but it is not yet encoded into Unicode. Therefore this advice, while generally correct, doesn't really help in this case.
Joey
@Johannes Röseel: +1 Good point. I added that. :) I think while my advice is generally correct but not relevant in this case, I still hope it will not be completely ignored by the OP. Every useful advice can still be a good thing, even if it is not a direct answer. :)
Mark Byers
Well, it will be valid in a few months ;-). The UTC has a meeting in late August or September, I think where quick-encoding the Indian Rupee sign will certainly be discussed. A proposal has already been submitted.
Joey
@Johannes Rössel: True but be careful though: Not all browsers will support the new character immediately. You should check first that the major browsers all support the new character before deciding to use it.
Mark Byers
The browsers (or applications in general) aren't the problem – they simply tell the rendering engine to render a specific code point; the fonts are. But it worked well enough for the Euro symbol (€) and this time we don't even have the problem to add the new symbol to legacy encodings.
Joey
@Joannes Rössel: True but the *real problem* here is trying to using HTML entities in the first place. I really think that this practice should be discouraged in new code. I am sure that the OP will ignore my advice. But I hope at least one person searching on Google reads this...
Mark Byers
@Johannes Rössel: After thinking about it I think I will delete this answer and submit it as a comment instead... that way maybe at least the OP will see it and at the same time it will avoid adding noise to the answers. Thanks for your comments.
Mark Byers
Imho, you can leave this answer here. It's still a good point and I think our discussion here doesn't hurt either. The votes on the answers still make sure it doesn't add that much answer noise, I think.
Joey
A: 

According to Wikipedia, the new rupee sign hasn't been added to Unicode yet, so you can't use it from HTML. The old one is ₨

David