private static void printAscii(Stream fd, string cp)
{
for (int cpPos = 0; cp[cpPos] != '\0'; cpPos++)
{
if (!char.IsControl(cp[cpPos]))
{
fprintf(fd, "{0}", cp[cpPos]);
continue;
}
string tp = "\tt\bb\rr\nn\vv";
int tpPos = 0;
for (; tp[tpPos] != 0; tpPos++)
{
if (tp[tpPos++] == cp[cpPos])
break;
}
if (tp[tpPos] != 0)
fprintf(fd, "\\{0}", tp[tpPos]);
else
fprintf(fd, "\\{0}", encodeOctalString((byte)(cp[cpPos] & 0xff)));
}
}