generalized ansi/ascii conversion mechanism