An ordinary character literal that contains a
single c-char representable in the execution character
set has type char, with value equal to the
numerical value of the encoding of the c-char in the
execution character set.
A multicharacter literal, or an ordinary character literal containing
a single c-char not representable in the execution
character set, is conditionally-supported, has type int,
and has an implementation-defined value.
The value of a UTF-8 character literal
is equal to its ISO/IEC 10646 code point value,
provided that the code point value
can be encoded as a single UTF-8 code unit.
The value of a UTF-16 character literal
is equal to its ISO/IEC 10646 code point value,
provided that the code point value is
representable with a single 16-bit code unit.
The value of a wide-character literal containing a single
c-char has value equal to the numerical value of the encoding
of the c-char in the execution wide-character set, unless the
c-char has no representation in the execution wide-character set, in which
case the value is implementation-defined.
Certain non-graphic characters, the single quote ', the double quote ",
the question mark ?,18
and the backslash
\, can be represented according to
Table 9.
The double quote " and the question mark ?, can be
represented as themselves or by the escape sequences
\" and \? respectively, but
the single quote ' and the backslash \
shall be represented by the escape sequences \' and
\\ respectively.
Escape sequences in
which the character following the backslash is not listed in
Table 9 are conditionally-supported, with implementation-defined semantics.
The escape
\ooo consists of the backslash followed by one,
two, or three octal digits that are taken to specify the value of the
desired character.
The escape
\xhhh
consists of the backslash followed by x followed by one or more
hexadecimal digits that are taken to specify the value of the desired
character.
There is no limit to the number of digits in a hexadecimal
sequence.
A sequence of octal or hexadecimal digits is terminated by the
first character that is not an octal digit or a hexadecimal digit,
respectively.
The value of a character-literal is implementation-defined if it falls outside of the implementation-defined
range defined for char (for character-literals with no prefix) or
wchar_t (for character-literals prefixed by L).