|
-
January 9th, 2008, 12:46 PM
#1
To Unicode or not to Unicode? That is really the question.
Since Visual Studio 2005, the default configuration for C++ is to use the Unicode character set. The purpose was to allow a fuller character set for language internationalization. If there is some other purpose, I cannot think of it. Consequently, there have proliferated an entire host of macros and functions that usually have the 'w' prefix. Once one descends into the murky depths of 'wide character strings', one will find themselves hopelessly entrapped in a kelp bed of inconsistencies and arcane semi-solutions, longing to return to the Multi-byte character sets of old.
But alas, it is probably too late. The push is on to use Unicode. Soon legacy code containing only Multi-byte character set configuration will not compile or run.
With that off my chest, I have found a couple of websites that I have found somewhat helpful.
http://www-ccs.ucsd.edu/c/wchar.html#wcsncpy
http://members.gamedev.net/sicrane/a...ndStreams.html
But some burning questions remain.
1) What is the difference between wchar_t * and wstring ? These types can be assigned to one another, but functions like wcscpy_s will not let you copy from 1 to the other.
2) Even though the compiler is set to use the Unicode character set, you still can use the multi-byte character set, but not interchangeably. So the two can coexist, which can make things really confusing.
3) If one is not going to be writing code for languages other than English, is there any other good reason to use Unicode ?
I would be interested in your guruish thoughts on these matters.
Mike
mpliam
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|