I am writing a program in c++ using gcc. I have an utf8 coded source file and I want string literals from my source file as UTF-16 strings. I use the gcc option -municode, which defines the UNICODE macro. String literals are still implemented as const char *. When I use TEXT("hello world"), it is still a const char *
Also, I would like to know which macro to define, or which commandline option to use, to have 16 bit traits in the std::string objects and al the template instantiations of the std library (I want std::char_traits to be of wchar_t.
wchar_t
rather than 16-bit as Microsoft does? In that case there may be no way to create UTF-16 literals. – Mark Ransom