How to Use Character Entities in CSS, HTML and JavaScript

tmirror
How to Use Character Entities in CSS, HTML and JavaScript
Sometimes, when using scripts, we must write special characters like accents by using a special set of codes called character entities. However, these don't always look good or we get a question mark or other strange symbols. Usually, this is solved if the character encoding is done right but the logic may not always work. In Blogger, special characters most of the time appear correctly, but when it is about other services, like external files, things can get complicated. For example, this usually looks good and when you click on this link , you should see the letters in the right way: alert(" á é í ó ú  ☺ ✛ ❤ "); If we are trying to use other method and we want to use this type of characters, sometimes we need to write them in a special format called escape sequence which is nothing but a backslash followed by a letter and a number in hexadecimal format. In the case of common characters or accents, it would be \x followed by two hex digits: \x e1 is the letter á \x e9 is the …