Fix character conversion, and start working on telnet code processing