The assignment of characters to code points is a crucial part of the Unicode standard. If you know the code point for a character, you’ll be able to use the character in various contexts. In Windows, Unicode symbols are inserted using a special key combination on the normal hard keyboard. Please note that the code point number normally has to be entered in hexadecimal notation.
Programmers usually require the numeric character reference. The hexadecimal notation of a code point allows the Unicode character to be displayed in characters from the ASCII character set. We’ll show you how that process works in HTML; the process is generally the same for Python, C++, and other languages.
The general formula for inserting a character using its numeric reference includes the reference itself as well as an opening and closing term. In HTML documents, the numeric reference is opened with “&#x” and closed with “;”. The two to four digit hexadecimal code point should be inserted in between these two terms, resulting in the pattern “&#xNNNN;”.
For example, to insert the copyright symbol “©” into an HTML document, you should follow these steps:
- Look for the character in the Unicode table.
- Check the code point for the character. In this example, the code point is “U+00A9” in hexadecimal notation.
- Create the character reference and insert it into the HTML source text or a markdown document.
In our case, we’ll insert “©”, which will give us the rendered character “©”.
There is also a less common method, which uses code points in decimal rather than hexadecimal notation. In this case, the numerical reference will begin with “&#” (without the “x”) and end as before with “;”. The code point in decimal notation comes in between. For the copyright symbol, the result would be “©”.