Moved all ANSI codes to the encoder