Changed getChar and retract to properly deal with unicode