Re: STL, cout, wcout, TCHAR, unicode?
Gerry Hickman wrote:
Hi,
After looking at this in more detail, it appears there's more to it. I
have a project that demonstrates all the STL classes. When I started
trying to convert it, I found the task is not straightforward; the sheer
number of instances of cout, string, ofstream, then templates and
typedefs in header files adds up to a LOT of changes. Then I also
noticed this article
http://www.codeproject.com/vcpp/stl/upgradingstlappstounicode.asp
Most of it is over my head, but it raises other issues such as
unexpected conversions.
Thing is, I don't really need UNICODE for internationalization purposes,
my real concern is that I want all my "string" data to be compatible
with Microsoft WinAPI and COM, and I'm guessing that means I should run
with UNICODE. Not an issue with the WinAPI types, but seems a bit of a
headache with STL:(
Gerry:
What do you think is the problem exactly?
As to the #define's and typedef's for the C++ Standard Library, I just
have a header file that is used in each of my projects, and whenever I
need anything that isn't there I just add it.
But for me it's 99% tstring and tstringstream. I write my data files in
UTF-8, so I don't need wofstream. In Windows GUI programs I don't use
cout, and most of my console programs are cross-platform so I usually
just use 8-bit strings.
People say that std::string and std::wstring are not Unicode aware. This
is true, but neither are CStringA and CStringW for the most part.
--
David Wilkinson
Visual C++ MVP