I realized that my program has to be able to handle special characters such as Japanese or Chinese. But I know the built-in type char
is far from enough. So how can I use these special characters in C program?
You need to use wide characters.
They're what you need for Unicode, they can get work with pretty much every character you throw it at, and it can do that because -- and this is the catch: it consumes more bytes (twice as much; it sounds tons but for the most part, it's really not).
Note:
In Windows programming you use the TEXT("")
macro to choose whether your characters will be Unicode or ANSI. it'll choose according to your project's setting.
If you insist to have it Unicode you can write the string with a prefix of the L
letter like so: L"Unicode String"
The header file to work with wide-characters is wchar.h
.