unicode - number of digits in a hex escape code in C/C++ -
i'm having dispute colleague of mine. says following:
char* = "\x000aaxz";
will/can seen compiler "\x000aa". not agree her, think can have maximum number of 4 hex characters after \x
. can have more 4 hex chars?
who right here?
§2.13.2/4:
the escape \xhhh consists of backslash followed x followed 1 or more hexadecimal digits taken specify value of desired character. there no limit number of digits in hexadecimal sequence. sequence of octal or hexadecimal digits terminated first character not octal digit or hexadecimal digit, respectively.
she right.
however, can terminate eager catenation: sequence of literals "\x000a" "axz"
specifies single four-character string literal. (2.13.4/3)
also note unicode uses 21-bit code points; doesn't stop @ 16 bits.
Comments
Post a Comment