C++ Logo

sg16

Advanced search

[isocpp-sg16] Thoughts on P4235R0: Removing Digraphs

From: Tom Honermann <tom_at_[hidden]>
Date: Wed, 23 Sep 2026 14:48:54 -0400
Hi, Matthias. A few questions/comments on P4235R0 (Removing Digraphs)
<https://wg21.link/p4235r0>.

First, thank you for a thorough paper; I love seeing all the history
presented!

Have you reached out to Keld Simonsen for comment regarding the history
and the original intent? I can put you in touch with him if you don't
have contact information.

The introduction states, "Digraphs are a complicated solution to a very
old problem ...". I think it would be helpful to briefly describe the
problem_s_ they solve. The history section suggests that the problem
solved is source code written in character encodings that lack support
for (some of) the members of the /basic character set
<https://eel.is/c++draft/lex.charset#def:character_set,basic>/. That is
one of the problems, but not the only one. Digraphs also allow source
code to be written in a subset of characters that allow it to be
correctly interpreted in multiple incompatible character encodings. I
think this is best exemplified by relating the digraphs to the variant
members of EBCDIC. According to IBM documentation
<https://www.ibm.com/docs/en/i/7.6.0?topic=considerations-runtime-character-set>, the
variant EBCDIC members that are also members of the basic character set
include:

*Unicode character name* *Character* *Digraph* *Comment*
U+0021 EXCLAMATION MARK !
 
U+0023 NUMBER SIGN # %: with %:%: for ##
U+0024 DOLLAR SIGN $
 Added in C++26
U+0040 COMMERCIAL AT @
 Added in C++26
U+007C VERTICAL LINE |
 
U+005B LEFT SQUARE BRACKET [ <:
U+005C REVERSE SOLIDUS \
 
U+005D RIGHT SQUARE BRACKET ] :>
U+005E CIRCUMFLEX ACCENT ^
 
U+0060 GRAVE ACCENT `
 Added in C++26
U+007B LEFT CURLY BRACKET { <%
U+007D RIGHT CURLY BRACKET } %>
U+007E TILDE ~
 

It is perhaps worth noting that digraphs are lacking for some members of
the basic character set that do not have invariant encoding across all
EBCDIC code pages.

The paper could also explicitly mention that /universal-character-name
<https://eel.is/c++draft/lex#nt:universal-character-name>/s provide a
modern alternative to digraphs.

Tom.

Received on 2026-09-23 18:48:59