Re: Unicode characters in identifiers

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Thanks Vladimir,

I have overlooked the reference to Annex E in the standard.

Richard


Vladimir Nesterovsky schrieb:
Where can I find which Unicode characters are valid for identifiers in
Visual C++ 2005?
According to the VC++ documentation:
...

More accurate definition according to the spec is:

2.10 Identifiers [lex.name]
identifier:
nondigit
identifier nondigit
identifier digit

nondigit: one of
universal-character-name
_ a b c d e f g h i j k l m
n o p q r s t u v w x y z
A B C D E F G H I J K L M
N O P Q R S T U V W X Y Z

digit: one of
0 1 2 3 4 5 6 7 8 9

1 An identifier is an arbitrarily long sequence of letters and digits. Each universal-character-name in an identifier shall designate a character whose encoding in ISO 10646 falls into one of the ranges specified in Annex E. Upper- and lower-case letters are different. All characters are significant.

2 In addition, some identifiers are reserved for use by C++ implementations and standard libraries (17.4.3.1.2) and shall not be used otherwise; no diagnostic is required.

This means that national characters can be a part of a name. I've tested Russian and Hebrew characters. It's worked.
--
Vladimir Nesterovsky


.



Relevant Pages