<s>
In	O
computer	B-General_Concept
programming	I-General_Concept
,	O
digraphs	B-Language
and	I-Language
trigraphs	I-Language
are	O
sequences	O
of	O
two	O
and	O
three	O
characters	O
,	O
respectively	O
,	O
that	O
appear	O
in	O
source	O
code	O
and	O
,	O
according	O
to	O
a	B-Language
programming	I-Language
language	I-Language
's	O
specification	O
,	O
should	O
be	O
treated	O
as	O
if	O
they	O
were	O
single	O
characters	O
.	O
</s>
<s>
Various	O
reasons	O
exist	O
for	O
using	O
digraphs	B-Language
and	I-Language
trigraphs	I-Language
:	O
keyboards	B-Device
may	O
not	O
have	O
keys	O
to	O
cover	O
the	O
entire	O
character	B-General_Concept
set	I-General_Concept
of	O
the	O
language	O
,	O
input	O
of	O
special	O
characters	O
may	O
be	O
difficult	O
,	O
text	B-Application
editors	I-Application
may	O
reserve	O
some	O
characters	O
for	O
special	O
use	O
and	O
so	O
on	O
.	O
</s>
<s>
Trigraphs	B-Language
might	O
also	O
be	O
used	O
for	O
some	O
EBCDIC	B-Language
code	O
pages	O
that	O
lack	O
characters	O
such	O
as	O
{	O
and	O
}	O
.	O
</s>
<s>
The	O
basic	O
character	B-General_Concept
set	I-General_Concept
of	O
the	O
C	B-Language
programming	I-Language
language	I-Language
is	O
a	O
subset	O
of	O
the	O
ASCII	B-Protocol
character	I-Protocol
set	I-Protocol
that	O
includes	O
nine	O
characters	O
which	O
lie	O
outside	O
the	O
ISO	O
646	O
invariant	O
character	B-General_Concept
set	I-General_Concept
.	O
</s>
<s>
This	O
can	O
pose	O
a	O
problem	O
for	O
writing	O
source	O
code	O
when	O
the	O
encoding	B-Algorithm
(	O
and	O
possibly	O
keyboard	B-Device
)	O
being	O
used	O
does	O
not	O
support	O
any	O
of	O
these	O
nine	O
characters	O
.	O
</s>
<s>
The	O
ANSI	O
C	B-Language
committee	O
invented	O
trigraphs	B-Language
as	O
a	O
way	O
of	O
entering	O
source	O
code	O
using	O
keyboards	B-Device
that	O
support	O
any	O
version	O
of	O
the	O
ISO	O
646	O
character	B-General_Concept
set	I-General_Concept
.	O
</s>
<s>
Trigraphs	B-Language
are	O
not	O
commonly	O
encountered	O
outside	O
compiler	B-Language
test	O
suites	O
.	O
</s>
<s>
Some	O
compilers	B-Language
support	O
an	O
option	O
to	O
turn	O
recognition	O
of	O
trigraphs	B-Language
off	O
,	O
or	O
disable	O
trigraphs	B-Language
by	O
default	O
and	O
require	O
an	O
option	O
to	O
turn	O
them	O
on	O
.	O
</s>
<s>
Some	O
can	O
issue	O
warnings	O
when	O
they	O
encounter	O
trigraphs	B-Language
in	O
source	O
files	O
.	O
</s>
<s>
Borland	O
supplied	O
a	O
separate	O
program	O
,	O
the	O
trigraph	B-Language
preprocessor	O
(	O
TRIGRAPH.EXE	O
)	O
,	O
to	O
be	O
used	O
only	O
when	O
trigraph	B-Language
processing	O
is	O
desired	O
(	O
the	O
rationale	O
was	O
to	O
maximise	O
speed	O
of	O
compilation	B-Language
)	O
.	O
</s>
<s>
Different	O
systems	O
define	O
different	O
sets	O
of	O
digraphs	B-Language
and	I-Language
trigraphs	I-Language
,	O
as	O
described	O
below	O
.	O
</s>
<s>
Early	O
versions	O
of	O
ALGOL	B-Language
predated	O
the	O
standardized	O
ASCII	B-Protocol
and	O
EBCDIC	B-Language
character	B-General_Concept
sets	I-General_Concept
,	O
and	O
were	O
typically	O
implemented	O
using	O
a	O
manufacturer-specific	O
six-bit	O
character	B-General_Concept
code	I-General_Concept
.	O
</s>
<s>
A	O
number	O
of	O
ALGOL	B-Language
operations	O
either	O
lacked	O
codepoints	O
in	O
the	O
available	O
character	B-General_Concept
set	I-General_Concept
or	O
were	O
not	O
supported	O
by	O
peripherals	O
,	O
leading	O
to	O
a	O
number	O
of	O
substitutions	O
including	O
:=	O
for	O
←	O
(	O
assignment	O
)	O
and	O
>=	O
for	O
≥	O
(	O
greater	O
than	O
or	O
equal	O
)	O
.	O
</s>
<s>
The	O
Pascal	B-Application
programming	I-Application
language	I-Application
supports	O
digraphs	B-Language
(	O
.	O
,	O
.	O
</s>
<s>
However	O
,	O
many	O
compilers	B-Language
treat	O
them	O
as	O
a	O
different	O
type	O
of	O
commenting	O
block	O
rather	O
than	O
as	O
actual	O
digraphs	B-Language
,	O
that	O
is	O
,	O
a	O
comment	O
started	O
with	O
( *	O
cannot	O
be	O
closed	O
with	O
}	O
and	O
vice	O
versa	O
.	O
</s>
<s>
The	O
J	B-Language
programming	I-Language
language	I-Language
is	O
a	O
descendant	O
of	O
APL	B-Language
but	O
uses	O
the	O
ASCII	B-Protocol
character	I-Protocol
set	I-Protocol
rather	O
than	O
APL	B-Language
symbols	I-Language
.	O
</s>
<s>
Because	O
the	O
printable	O
range	O
of	O
ASCII	B-Protocol
is	O
smaller	O
than	O
APL	B-Language
's	O
specialized	O
set	O
of	O
symbols	O
,	O
.	O
</s>
<s>
(	O
dot	O
)	O
and	O
:	O
(	O
colon	O
)	O
characters	O
are	O
used	O
to	O
inflect	O
ASCII	B-Protocol
symbols	O
,	O
effectively	O
interpreting	O
unigraphs	O
,	O
digraphs	B-Language
or	O
rarely	O
trigraphs	B-Language
as	O
standalone	O
"	O
symbols	O
"	O
.	O
</s>
<s>
Unlike	O
the	O
use	O
of	O
digraphs	B-Language
and	I-Language
trigraphs	I-Language
in	O
C	B-Language
and	O
C++	B-Language
,	O
there	O
are	O
no	O
single-character	O
equivalents	O
to	O
these	O
in	O
J	B-Language
.	O
</s>
<s>
Trigraph	B-Language
Equivalent	O
?	O
</s>
<s>
The	O
C	B-Language
preprocessor	I-Language
(	O
used	O
for	O
C	B-Language
and	O
with	O
slight	O
differences	O
in	O
C++	B-Language
;	O
see	O
below	O
)	O
replaces	O
all	O
occurrences	O
of	O
the	O
nine	O
trigraph	B-Language
sequences	O
in	O
this	O
table	O
by	O
their	O
single-character	O
equivalents	O
before	O
any	O
other	O
processing	O
(	O
until	O
C23	B-Language
)	O
.	O
</s>
<s>
A	O
programmer	O
may	O
want	O
to	O
place	O
two	O
question	O
marks	O
together	O
yet	O
not	O
have	O
the	O
compiler	B-Language
treat	O
them	O
as	O
introducing	O
a	O
trigraph	B-Language
.	O
</s>
<s>
The	O
C	B-Language
grammar	O
does	O
not	O
permit	O
two	O
consecutive	O
?	O
</s>
<s>
tokens	O
,	O
so	O
the	O
only	O
places	O
in	O
a	O
C	B-Language
file	O
where	O
two	O
question	O
marks	O
in	O
a	O
row	O
may	O
be	O
used	O
are	O
in	O
multi-character	O
constants	O
,	O
string	B-Language
literals	I-Language
,	O
and	O
comments	O
.	O
</s>
<s>
This	O
is	O
particularly	O
a	O
problem	O
for	O
the	O
classic	B-Application
Mac	I-Application
OS	I-Application
,	O
where	O
the	O
constant	O
'	O
????	O
'	O
</s>
<s>
To	O
safely	O
place	O
two	O
consecutive	O
question	O
marks	O
within	O
a	O
string	B-Language
literal	I-Language
,	O
the	O
programmer	O
can	O
use	O
string	O
concatenation	O
"	O
...	O
?	O
""	O
?...	O
"	O
</s>
<s>
is	O
not	O
itself	O
a	O
trigraph	B-Language
sequence	O
,	O
but	O
when	O
followed	O
by	O
a	O
character	O
such	O
as	O
-	O
it	O
will	O
be	O
interpreted	O
as	O
?	O
</s>
<s>
?	O
/	O
trigraph	B-Language
can	O
be	O
used	O
to	O
introduce	O
an	O
escaped	O
newline	O
for	O
line	O
splicing	O
;	O
this	O
must	O
be	O
taken	O
into	O
account	O
for	O
correct	O
and	O
efficient	O
handling	O
of	O
trigraphs	B-Language
within	O
the	O
preprocessor	O
.	O
</s>
<s>
The	O
concept	O
can	O
be	O
used	O
to	O
check	O
for	O
trigraphs	B-Language
as	O
in	O
the	O
following	O
C99	B-Language
example	O
,	O
where	O
only	O
one	O
return	O
statement	O
will	O
be	O
executed	O
.	O
</s>
<s>
In	O
1994	O
,	O
a	O
normative	O
amendment	O
to	O
the	O
C	B-Language
standard	O
,	O
included	O
in	O
C99	B-Language
,	O
supplied	O
digraphs	B-Language
as	O
more	O
readable	O
alternatives	O
to	O
five	O
of	O
the	O
trigraphs	B-Language
.	O
</s>
<s>
Unlike	O
trigraphs	B-Language
,	O
digraphs	B-Language
are	O
handled	O
during	O
tokenization	O
,	O
and	O
any	O
digraph	B-Language
must	O
always	O
represent	O
a	O
full	O
token	O
by	O
itself	O
,	O
or	O
compose	O
the	O
token	O
%	O
:	O
%	O
:	O
replacing	O
the	O
preprocessor	O
concatenation	O
token	O
##	O
.	O
</s>
<s>
If	O
a	O
digraph	B-Language
sequence	O
occurs	O
inside	O
another	O
token	O
,	O
for	O
example	O
a	O
quoted	O
string	O
,	O
or	O
a	O
character	O
constant	O
,	O
it	O
will	O
not	O
be	O
replaced	O
.	O
</s>
<s>
C++	B-Language
(	O
through	O
C++14	B-Language
,	O
see	O
below	O
)	O
behaves	O
like	O
C	B-Language
,	O
including	O
the	O
C99	B-Language
additions	O
,	O
but	O
with	O
additional	O
tokens	O
listed	O
in	O
the	O
table	O
.	O
</s>
<s>
The	O
C++	B-Language
Standard	O
makes	O
this	O
comment	O
with	O
regards	O
to	O
the	O
term	O
"	O
digraph	B-Language
"	O
:	O
</s>
<s>
Trigraphs	B-Language
were	O
proposed	O
for	O
deprecation	O
in	O
C++0x	B-Language
,	O
which	O
was	O
released	O
as	O
C++11	B-Language
.	I-Language
</s>
<s>
This	O
was	O
opposed	O
by	O
IBM	O
,	O
speaking	O
on	O
behalf	O
of	O
itself	O
and	O
other	O
users	O
of	O
C++	B-Language
,	O
and	O
as	O
a	O
result	O
trigraphs	B-Language
were	O
retained	O
in	O
C++11	B-Language
.	I-Language
</s>
<s>
Trigraphs	B-Language
were	O
then	O
proposed	O
again	O
for	O
removal	O
(	O
not	O
only	O
deprecation	O
)	O
in	O
C++17	B-Language
.	O
</s>
<s>
This	O
passed	O
a	O
committee	O
vote	O
,	O
and	O
trigraphs	B-Language
(	O
but	O
not	O
the	O
additional	O
tokens	O
)	O
are	O
removed	O
from	O
C++17	B-Language
despite	O
the	O
opposition	O
from	O
IBM	O
.	O
</s>
<s>
Existing	O
code	O
that	O
uses	O
trigraphs	B-Language
can	O
be	O
supported	O
by	O
translating	O
from	O
the	O
source	O
files	O
(	O
parsing	O
trigraphs	B-Language
)	O
to	O
the	O
basic	O
source	O
character	B-General_Concept
set	I-General_Concept
that	O
does	O
not	O
include	O
trigraphs	B-Language
.	O
</s>
<s>
Hewlett-Packard	O
calculators	O
supporting	O
the	O
RPL	B-Device
language	O
and	O
input	O
method	O
provide	O
support	O
for	O
a	O
large	O
number	O
of	O
trigraphs	B-Language
(	O
also	O
called	O
TIO	O
codes	O
)	O
to	O
reliably	O
transcribe	O
non-seven-bit	O
ASCII	O
characters	O
of	O
the	O
calculators	O
 '	O
extended	O
character	B-General_Concept
set	I-General_Concept
on	O
foreign	O
platforms	O
,	O
and	O
to	O
ease	O
keyboard	B-Device
input	O
without	O
using	O
the	O
application	O
.	O
</s>
<s>
The	O
first	O
character	O
of	O
all	O
TIO	O
codes	O
is	O
a	O
\,	O
followed	O
by	O
two	O
other	O
ASCII	B-Protocol
characters	I-Protocol
vaguely	O
resembling	O
the	O
glyph	O
to	O
be	O
substituted	O
.	O
</s>
<s>
All	O
other	O
characters	O
can	O
be	O
entered	O
using	O
the	O
special	O
\nnn	O
TIO	O
code	O
syntax	O
with	O
nnn	O
being	O
a	O
three-digit	O
decimal	O
number	O
(	O
with	O
leading	O
zeros	O
if	O
necessary	O
)	O
of	O
the	O
corresponding	O
code	O
point	O
(	O
thereby	O
formally	O
representing	O
a	O
tetragraph	B-Language
)	O
.	O
</s>
<s>
The	O
Vim	B-Application
text	B-Application
editor	I-Application
supports	O
digraphs	B-Language
for	O
actual	O
entry	O
of	O
text	O
characters	O
,	O
following	O
.	O
</s>
<s>
The	O
entry	O
of	O
digraphs	B-Language
is	O
bound	O
to	O
by	O
default	O
.	O
</s>
<s>
The	O
list	O
of	O
all	O
possible	O
digraphs	B-Language
in	O
Vim	B-Application
can	O
be	O
displayed	O
by	O
typing	O
.	O
</s>
<s>
GNU	B-Application
Screen	I-Application
has	O
a	O
digraph	B-Language
command	O
,	O
bound	O
to	O
by	O
default	O
.	O
</s>
<s>
Lotus	B-Application
1-2-3	I-Application
for	O
DOS	B-Device
uses	O
as	O
compose	B-Device
key	I-Device
to	O
allow	O
easier	O
input	O
of	O
many	O
special	O
characters	O
of	O
the	O
Lotus	O
International	B-General_Concept
Character	I-General_Concept
Set	I-General_Concept
(	O
LICS	O
)	O
and	O
Lotus	B-Operating_System
Multi-Byte	I-Operating_System
Character	I-Operating_System
Set	I-Operating_System
(	O
LMBCS	B-Operating_System
)	O
.	O
</s>
