I coded a very simple test of the level of support for
wide character strings in a C/C++ compiler. Unfortunately
it shows that there are still compilers out there that
will have trouble even at the entry level of Unicode functionality.
wchar_t *foo = L"\x4e00 = jit7 in Hakka";
int i = 0;
printf("%04X ", foo[i]);
if (foo[i] < 128)
else if (foo[i]>=0x4e00 && foo[i] < 0x9fff)
Compiled with Borland 5.01 compiler under Win 95 gives:
wchar_t *foo = L"\x4e00 is jit7 in Hakka";
(error) Numeric constant too large
(warning) Hexadecimal value contains more than 3 digits
The program compiles and executes just fine under
Next, I'll be trying it under Microsoft C++ 4.0.
Anyone want to try other compilers & platforms? If the program
compiles, then try running the executable - the output should look
4E00 <Han character>
It has to compile and execute - making wchar_t at least 16 bits is
Let's get these compilers going for the future!
This archive was generated by hypermail 2.1.2 : Tue Jul 10 2001 - 17:20:33 EDT