In-depth understanding of character encoding