I see that Visual Studio 2008 and later now start off a new solution with the Character Set set to Unicode. My old C++ code deals with only English ASCII text and is full of:
- Literal strings like
"Hello World"
char
typechar *
pointers to allocated C stringsSTL string
typeConversions from
STL string
to C string and vice versa usingSTL string
constructor (which acceptsconst char *
) andSTL string.c_str()
What are the changes I need to make to migrate this code so that it works in an ecosystem of Visual Studio Unicode and Unicode enabled libraries? (I have no real need for it work with both ASCII and Unicode, it can be pure Unicode.)
Is it also possible to do this in a platform independent way? (i.e., by not using Microsoft types.)
I see so many wide character and Unicode types and conversions scattered around, hence my confusion. (Ex: wchar_t, TCHAR, _T, _TEXT, TEXT etc.)