Why would you want such a thing?
I doubt such code would be compilable on all C++ compilers

12-09-2004

Sang-drax

I don't know. Perhaps I can throw in some unicode characters when helping with the stupider kind of homework questions. When they complain I'll just reference to the standard.

I noticed that my current compiler couldn't handle it and I just wanted to know if Microsofts new complier was any better.

12-10-2004

Salem

Perhaps you're confusing the source character set (the one the program is written in) with the execution character set (the one the program is able to use to communicate with the outside world)

12-10-2004

anonytmouse

I did some testing with MSVC.NET a while back. If I remember correctly, it successfully compiled source code saved as UTF-8 or UTF-16LE. This was with the command line version, I'm not sure if the IDE offers the same support. I only tested with unicode characters in string literals, I can't vouch for unicode characters in variable names.

12-13-2004

Sang-drax

Quote:

Originally Posted by Salem

Perhaps you're confusing the source character set (the one the program is written in) with the execution character set (the one the program is able to use to communicate with the outside world)

I don't have the standard here at this computer, so I cannot quote anything. I'm quite sure some unicode characters can be used in identifier names though.
I'll have to get back to this when my Internet connection starts working. It has been down for days. :(

12-13-2004

Thantos

Perhaps this is what you are looking for Sang-drax?

Quote:

Section 2.10.1
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.20)
[...]
20) On systems in which linkers cannot accept extended characters, an encoding of the universal-character-name may be used in forming valid external identifiers. For example, some otherwise unused character or sequence of characters may be used to encode the \u
in a universal-character-name. Extended characters may produce a long external identifier, but C + + does not place a translation limit on significant characters for external identifiers. In C + +, upper- and lower-case letters are considered different for all identifiers, including
external identifiers.

12-13-2004

Sang-drax

Yup, Annex E at the end of the document contains the valid characters that can be used. Quite a few, actually. BTW, my connection is up again. :)