Better UTF-8 handling in the Huffman coder (thanks to Frédéric Kayser)