gcc, clang, g++, and clang++ all compile (without any warnings or errors) and run the following (without any extra compile flags):
#include <stdio.h>
void grëéþt() {
int á = 4;
char ñame[] = "wórød";
printf("hélló %s:%d\n", ñame
, á
); }
int main () {
grëéþt();
return 0;
}
https://en.cppreference.com/w/cpp/language/identifiers
https://en.cppreference.com/w/c/language/identifier
Both the C and C++ standards allow for non-ASCII Unicode characters in identifiers.
The above code does not compile using gcc on an Ubuntu 20.04 system, while a few years old, its is still a "officially supported" OS for some time now. So, as tetrastes said, it might work on your desktop, but it might not work on someone else's ! And what use is code if its not portable. ?
After testrastres pointed out, it is up to the implementation for C. For C++ I don't see the the same wording for C++, and it appears that since C++11 it is allowed.
But as I pointed out earlier
And in languages that allow non-ASCII identifiers I don't create them myself, as I have no need to
(because for me they would add no value)
I have to admit, I overreacted a bit, but the standards do allow for them, less so for C, but more so for C++ since C++11. Since 3 major compilers support them, I don't consider that fringe, and that is one of the things I was reacting to.
As far as portable, and yeah, I know it makes things difficult when such a mindset spills into too many projects, I've been on projects where generally only recent (past year or so) (or latest stable release) tool chains are supported.