Sketch of character decoder