There is no support for a generic (variable-width) chararacter like TCHAR
in standard C++. C++ does have wchar_t
, but the encoding isn't guaranteed. C++1x will much improve things once we have char16_t
and char32_t
as well as UTF-{8,16,32} literals.
I personally am not a big fan of generic characters because they lead to some nasty problems (like conversion) and, what's more, if you are using a type (like TCHAR
) that might ever have a maximum width of 8, you might as well code with char
. If you really need that backwards-compatibility, just use UTF-8; it is specifically designed to be a strict superset of ASCII. You may have to use conversion APIs (especially on Windows, which for some bizarre reason is UTF-16), but at least it'll be consistent.
EDIT: To actually answer the original question, other platforms typically have no such construct. You will have to define your TCHAR on that platform, or else use a library that provides one (but as you should no doubt be able to guess, I'm not a big fan of that concept in libraries either).