Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Sinner_Zero

Unicode

This topic is 6090 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

So I''m reading this book on Win32 and all, Programming Windows, and this guy has his whole second chapter devoted to unicode, unicode, and more unicode! So here''s the question, how many people (you yourself or that you know) actually use unicode and it''s special functions or at least know them? Cuz personally I wouldnt mind using them and all if it helps the world just a little bit, you know, not that my code is important but if I ever do share it..........heh.......heh..... =/

Share this post


Link to post
Share on other sites
Advertisement
UNICODE is for the support of extended character codes, for languages such as Korean and Japanese (and others that may yet to be encoded.) If you''ve ever had to deal with internationalized software, UNICODE is essential. One of my former employers developed a text-to-speech system that supported several languages (including Chinese, Japanese, Korean, Portuguese, German, Parisian and Canadian French, US and British English among others.) For such an application, UNICODE is indispensable.

Share this post


Link to post
Share on other sites
If you''re careful, you can use the definitions in tchar.h to make it possible to compile for both Unicode and ANSI with a simple #define. This is good because under Windows NT operating systems (which means NT, 2000 and XP and any newer OS that MS releases in the future) uses Unicode internally. Any system calls in where you pass strings must have any ANSI strings converted to Unicode first. That''s quite a bit of overhead usually, so compiling you application with Unicode is a good idea since it removes the overhead. On Windows 9X systems, the reverse is true and compiling ANSI removes the overhead of converting from Unicode.

There is a "Unicode pack" for Windows 9X that actually uses the Unicode version, though, so it can''t be all bad...

Anyway, to use tchar.h you just do something like this:

  
#include <tchar.h>

int _tmain( int argc TCHAR **argv )
{
_tprintf( _T("Hello World!\n") );
}


Basically, change all references to "char" into "TCHAR" and put a _T() around all your strings. Most of the string function you just prepend a _t to, but some of them are a bit different (like _tcslen() instead of strlen() or _stprintf() instead of sprintf(), etc). The documentation tells the name of the _T version of the function (just look up the ANSI name).

All the Win32 functions keep the same name since internally they''re redefined to either MessageBoxA or MessageBoxW (or whatever) anyway.


codeka.com - Just click it.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!