About Unicode characters in html, xml
Hi! So you probably wonder how to put those special text symbols into HTML? You can do that using Unicode entities. Just copy-pasting the symbols into a HTML, or xml document doesn't work right sometimes. I'll show it to you, and guide you through the whole process of creating symbols straight from your keyboard.
But first you need to know several short basic things.
Things to know
Text encoding systems
Text encoding systems (also called charsets) are standards for numeric representation of text characters. They pair (define) numbers with text symbols. So a certain computer number means the certain text character. Encoding systems are used by all computers right now, because computers store information using numbers.
Humans actually tie characters and symbols to how they sound, or their names. But maybe that is somehow digitally-encoded in our brains as well. Who knows?..
Unicode
Unicode is a text encoding system. It pairs more than 100,000 text characters and symbols with their codes (numbers).
Simple, huh? So now I'll explain the rules of how to put text characters into HTML using these numeric codes. And how to get those codes, also.
Unicode codes table
You can get any Unicode-encoded character's numeric code from official Unicode code charts.
How to make HTML symbol codes
Here are principles inputting HTML symbols by their Unicode code.
-
If you have a decimal code.
Write "&#code;" in HTML.
Example: "ß" stands for "ß". -
If you have a hexadecimal code. It should contain numbers and letters from A to F range (should be alpha-numeric). Though it can fully consist of just numbers, or just letters. Like "«" stands for "«".
Write "ode;" in HTML.
Example: "ß" stands for "ß". -
If the code is HTML shortcut. The code should consist of letters only.
If symbol is some kind of word, like "hearts", it's probably a shortcut.
Write "&code;" in HTML.
Example: "♥" stands for "♥".
If it doesn't work, this code may really be hexadecimal, but with leading zero's omitted.
Be aware that you can translate any text symbol's decimal code into hex, and convert any hex code into decimal.
Keep in mind the bad thing, that nowadays not all symbols are supported even by major OS's and browsers.
Comments