Converting a Unicode Character Code to its UTF-8 Encoded Value

Unicode character codes are UTF-8 encoded before being stored in memory. A lot of languages, like HTML, do the conversion for us and allow us to just use the Unicode character code. However, some assemblers and compilers don't do this out of the box and some teachers like making you do the conversions by hand.

I decided to make a quick tutorial on how to do the conversion by hand in case Unicode character codes are not enough for your assembler, compiler or teacher. I am assuming you have already had an introduction to this topic and just want to know how to do the actual conversion. Neither hexadecimal nor binary numbers are explicitly denoted but they are pretty easy to tell apart.

Find the character code you want to convert to hex. These codes are in hex but for any code bigger than 7F you will need to do an extra conversion to get the actual hex value.

Quite simple, right?