cross-posted from: reddthat.com/post/67621851

Never though much about how stuff like UTF-8 actually works.

This article take a very good approach (starts with UTF-32 and shows how one can optimize it to save space).