Why can't I write U"\U00000020"?

112 views
Skip to first unread message

martinho....@gmail.com

unread,
Dec 6, 2012, 1:58:25 PM12/6/12
to std-dis...@isocpp.org
I just came across §2.3p2 which concerns universal character names and reads "(...) Additionally, if the hexadecimal value for a universal-character-name outside the c-char-sequence, s-char-sequence, or r-char-sequence of a character or string literal corresponds to a control character (in either of the ranges 0x00–0x1F or 0x7F–0x9F, both inclusive) or to a character in the basic source character set, the program is ill-formed."

This means that I cannot write U"\U00000020", and must instead write U" " or U"\x00000020". I cannot find a reasoning for forbiding the first form. Can anyone who knows a good reason for this chime in?

Richard Smith

unread,
Dec 7, 2012, 9:01:03 PM12/7/12
to std-dis...@isocpp.org
You appear to have misread the text you quoted. That is valid, because
it is within the s-char-sequence of a string literal.
Reply all
Reply to author
Forward
0 new messages