C language doesn't appear to be work this way. Is there any way to fix this?
Support for such characters is implementation defined. Many compilers will not support this, a few might.
An identifier may contain non-digits (a-z, A-Z, _), digits (0-9), universal-character-name or other implementation-defined characters. C17 6.4.2 1
Alternative
Since C99, code could use universal-character-name via \Unnnnnnnn
or \unnnn
- a not so pretty possibility.
An application would be to convert source code struct 忍び
(that worked on one compiler) to struct \u5fcd\u3073
for other compilers.
https://www.branah.com/unicode-converter
忍び --> \u5fcd\u3073
#include <stdio.h>
struct \u5fcd\u3073/* Shinobi */ {
char \u540d\u524d /* Namae */[50];
char \u8840\u6db2\u578b /* Ketsuekigata */[3];
char \u6027\u5225/* Seibetsu */[10];
char \u661f\u5360\u3044/* Hoshi uranai*/[10];
int \u5e74\u9f62/* Nenrei */;
};
int main(void) {
struct \u5fcd\u3073 Uchiha_Itachi;
Uchiha_Itachi.\u5e74\u9f62 = 21;
printf("the age of itachi > %d", Uchiha_Itachi.\u5e74\u9f62);
}
Note: using defines like below, are not specified to work either. Support for such is implementation defined.
// not certain to work
#define 忍び \u5fcd\u3073
If a strong need exists to "any way to fix this?", write your source code as a .wheldrake file and translate it to standard .c one.
Soapbox
One character I would like to use: ≠
, the not_equal sign.