Using HTML Symbol Entities instead of the actual symbol - Stack Overflow
How can I put the @ symbol in an html page? What is the entity? - Stack Overflow
[HTML] What do you call the "<" and ">" symbols around tags?
[Question] Prettify-symbols, can someone sell me on it or dissuade me from using it?
Videos
Using an HTML entity reference allows the entity to be represented as intended regardless of the encoding applied to the document. That is the benefit.
Rather than strictly using entities for all non-US-ASCII characters, feel free to use an encoding for your document that supports the document's target language, preferably one also supporting other languages, like UTF-8.
However, please avoid using any system-specific encoding, especially regular Windows encoding. It is often the case that Windows-1252 text is sent to other systems with the wrong label of ISO-8859-1.
In the past there has certainly been been less reliable support for numeric HTML entities than for named HTML entities (based on my own first-person eye witness observation), but in theory a numeric HTML entity is still character encoding independent and "safe" because the numeric value refers directly to a code point registered in the UCS (http://en.wikipedia.org/wiki/Universal_Character_Set) and equivalent to its defined character name.
Caveat: the following describes my own experience, and yours may vary.
HTML documents transferred by clients for me to work on with symbols directly embedded are very often corrupted and cannot be recovered. This may be a weakness of U.S. infrastructure or a lack of knowledge on the part of my customers about how to send their documents. The infrastructure and people in a country whose primary language relies on non-ASCII characters would be much more likely to support and understand how to properly transfer their documents with no corruption.
If you are developing your own website and uploading the final copies of your own files to your server, then the risk of corruption is very small.
If you do not have control over your document from the point you edit it to the point that it is served to users, then you run the risk (perhaps not today, but certainly within recent years in the U.S., a likelihood more than mere risk) of having the document improperly converted at some point along the way and being permanently corrupted regardless of what encoding you attempt to view it in.
No.
Entities and character references are useful only if:
- The character has special meaning in HTML at the point where you want to use the character (
/never will, it only has special meaning in places where you can't have a/as data anyway). - You can't type the character (e.g. because it doesn't appear on your keyboard).
- You can't encode the file as UTF-8 (or in another encoding that includes it … and
/appears in ASCII).
Character references are useful when the character you want to use
- has special meaning in HTML
- does not appear in ASCII (and you are stuck on an 20th century system that doesn't use UTF-8)
- doesn't appear on a standard keyboard so it hard to type (but copy/pasting is still usually a better bet)
- could be confused with another similar looking character (e.g. a space vs a non-breaking space)
None of those apply to the @ symbol. You should just type @.
That said, if you really want to use an entity, it is:
@
It takes 8 characters (and bytes) instead of 1.
As @Quentin has already indicated, you can use the HTML escape @ which is the same as both @ and simply typing @ on your keyboard and is represented in Unicode as U+0040.
However, there are, additionally, two more at symbols in Unicode, full-width and small:
U+FF20U+FE6B
For which the HTML escapes are:
@﹫
Example:
<h2>Standard <code>@</code> symbols</h2>
<ul>
<li>@ <code>[TYPED FROM KEYBOARD]</code></li>
<li>@ <code>[&commat;]</code></li>
<li>@ <code>[&#64;]</code></li>
</ul>
<h2>Alternative <code>@</code> symbols</h2>
<ul>
<li>@ <code>[&#65312;]</code> <em>full-width</em></li>
<li>﹫ <code>[&#65131;]</code> <em>small</em></li>
</ul>