Re: Why use UNICODE?
On Mon, 20 Oct 2008 19:59:06 -0700 (PDT), swtbase@gmail.com wrote:
Hi to all,
According to popular usage, I have been surrounding all my text in my
source code with TEXT(" ") (with UNICODE defined). I am using a
standard installation of XP with English as the default language.
I want to know what advantage do I have in my program with the above
being done when I output all error messages to users in English?
If all you ever use is US English, there is essentially no advantage beyond
speaking in the native tongue of Windows, which is Unicode. That is,
Windows won't have to convert to and from ANSI, which has a pretty much
negligible performance impact anyway. The downside of course is that your
character buffers and strings will take twice as much space, which again is
probably not going to be a problem.
How
will my program behave in, say a Chinese language computer?
It will display English characters. Unlike the situation with the ANSI code
pages, a Unicode character means the same thing everywhere.
My program
takes no text input from the user, should I still use UNICODE?
I would, and I'd most likely forgo the _T() macros and use L'x' and L"x"
instead, since I wouldn't be worried about back-porting to Win9X.
Concerning persistent textual data that can contain non-ASCII Unicode
characters, probably the best approach is to store it in UTF-8.
--
Doug Harrison
Visual C++ MVP