   [C++] Cross Platform Text (Character) Handling (without external libraries)
  Hi allI'm in the process of creating a game engine for turn-based RPGs in C++.I'm still at the beginning and I'd like to keep things cross-platform capable if possible. My target platforms are Windows, UNIX and Apple Mac (although sometimes I do think I should just forget about anything except Windows).Anyway, I need to handle text, and for various reasons I do NOT want to use any external / 3'rd party library to do so, but rather write what I need myself.I know how things are on Windows, TCHAR, 8-bit and 16-bit characters, depending on whether you've got UNICODE support turned on in Visual Studio or not.Specifically, what I need for a job is a safe version of the C-function sprintf().C99 has snprintf(), but Visual Studio does not support C99 and hence doesn't know it. Visual Studio instead offers _sprintf(), but I'm sure UNIX and Mac won't know that.Then there is the question of 8-bit or 16-bit characters. I have no idea if UNIX and Mac handle that the way Windows does.Here are my questions:1.) Do UNIX and Mac handle 8-bit and 16-bit characters like Windows? I mean on UNIX for instance, can you turn on and off UNICODE support and then all UNIX specific character functions resolve via macros to either 8-bit or 16-bit versions of the functions?2.) Should I simply #define my own, cross-platform character and function types that will resolve to TCHAR and _sprintf() on Windows and to whatever does the the same thing on UNIX and Mac?It's easy to #define a crossPlatformTCHAR and a crossPlatformSNPrintf() macro, but of course that means that UNIX and Mac handle text and characters somewhat similar to Windows and that crossPlatformTCHAR and crossPlatformSNPrintf() can resolve to something which works on those platforms as well.Any help by those savvy of UNIX or Mac text handling is appreciated!:-)Greetings,Mark   