I am revising some very old (10 years) C code. The code compiles on Unix/Mac with GCC and cross-compiles for Windows with MinGW. Currently there are TCHAR strings throughout. I’d like to get rid of the TCHAR and use a C++ string instead. Is it still necessary to use the Windows wide functions, or can I do everything now with Unicode and UTF-8?
Share
Windows uses UTF16 still and most likely always will. You need to use
wstringrather thanstringtherefore. Windows APIs don’t offer support for UTF8 directly largely because Windows supported Unicode before UTF8 was invented.It is thus rather painful to write Unicode code that will compile on both Windows and Unix platforms.