Correctly encodes and decodes chars and digrams