connection: Be more informative and safer when dealing with odd ANSI codes