   Unicode Support?
  This is my first post and I want to start by saying hello!I''ve gotten to the point where I feel comfortable with C++ and so now I''ve got three books I''ve decided I''m going to try and read concurrently.. Tricks of the Windows Game Programming Gurus, 3D Math Primer, and Programming Windows 5th Ed.  The question I have is.. how many people consider Unicode when they are writting a program?  I know in the Programming Windows book he commits the second chapter to it and then says he will be writting the rest of his programs so that all you''d have to do is use the _UNICODE identifier to switch from one to the other.  However, in the tutorials I''ve seen online, and in LaMothe''s book, they don''t really mention Unicode.  Is support for Unicode a really good idea or should I not really worry about it that much?Thanks   Don''''t keep jingling in the course of your conversation any intellectual money you may have.- Joseph Farrell 
  AFAIK, support for UNICODE is highest in WinNT including XP. But for windows 98 support is not so great. From what I''ve learned (from the same book by petzold I''m now reading) defining UNICODE with the preprocessor directive will automatically allow windows to choose one of two functions (usually one ending with ''w'') for implementing a particular task, (the other can end in ''a'' for regular ascii)I guess that you also have to account for each character as two bytes instead of one as well?I suppose others will comment on how often they choose to use it around here. It certainly is bulky if you use alot of text in a program. ;  It depends on the type of program you're working on, and the extent you want to go in implementing it.  If you're a shareware author and your goal is to get the game done, it might not be a good use of your time.  Unless you're doing it for fun or have plans for releasing it in many languages, I'd just go with regular ASCII.In my case, I'm just goofing off.  Just to give you some ideas, I'll mention how I went about it.  I wrote a custom string class as well as classes for each character format I wanted to support.  I found some support code on the unicode website which I've been using in my conversion constructors to let each character convert to the other ones.  Then, if I want to pass the string to a Windows function, I just convert the NativeString to a String&ltTCHAR&gt.  TCHAR is defined in the Windows headers and changes depending on whether UNICODE is defined.  I also have headers called NativeString.hpp and NativeChar.hpp which contain typedefs of the native character format for the game.  If I want to change the character format, I just change the type of NativeChar.  So I get a nice separation between the game and the operating system.  If you want me to go into more detail, ask here or just email me.edit: lost my brackets.   [edited by - dcosborn on February 13, 2004 9:16:27 PM];  I have all of my code using wide characters (because I can, no real reason to), and it isn''t really that different from programming normally, except you have to add w to some functions, and deal with the issue of the larger size of strings.  My only problem with using wide characters is that when you open a file using something such as std::wifstream::open(), you have to pass the filename as a narrow (normal) string.Personally, I found using TCHAR and #define _UNICODE to be tedious, leading to (ugly) compiler-dependent code.  Having underscores in front of every single function ( _T("string"), _tcsopen(), etc.) just makes my code feel illegible. 