2 #define PERL_IN_EBCDIC_C
5 /* in ASCII order, not that it matters */
6 static const char controllablechars[] = "?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_";
17 if ((ctlp = strchr(controllablechars, ch)) == 0) {
18 Perl_die(aTHX_ "unrecognised control character '%c'\n", ch);
21 if (ctlp == controllablechars)
22 return('\177'); /* DEL */
24 return((unsigned char)(ctlp - controllablechars - 1));
25 } else { /* Want uncontrol */
26 if (ch == '\177' || ch == -1)
28 else if (ch == '\157')
30 else if (ch == '\174')
32 else if (ch == '^') /* '\137' in 1047, '\260' in 819 */
34 else if (ch == '\155')
36 else if (0 < ch && ch < (sizeof(controllablechars) - 1))
37 return(controllablechars[ch+1]);
39 Perl_die(aTHX_ "invalid control request: '\\%03o'\n", ch & 0xFF);