Jump to content
  • Advertisement
Sign in to follow this  
Woodchuck

UNICODE

This topic is 4845 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

Advertisement
start by using L infront of your string literals when they should be unicode and use unicode methods/functions and libraries.

Many compilers have settings that allow you to define unicode. All they usually do is cause the compiler to #define UNICODE or _UNICODE and link with the unicode version of their std runtime libs.

Some compilers use _T infront of strings instead of L. Since we went unicode I've never seen use have a need for ansi so if its not available to you its probably not the end of the world.

Cheers
Chris

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Quote:
Original post by chollida1
Some compilers use _T infront of strings instead of L.

_T is a macro that is gives a Unicode string if UNICODE is defined, and an ansi string otherwise. I't simply a way of making your code build and work in both ANSI and UNICODE.

Quote:
Original post by chollida1
Since we went unicode I've never seen use have a need for ansi so if its not available to you its probably not the end of the world.

At least on Windows platforms there's no point in NOT using unicode. Having all code built in unicode makes it easier to localize. It could also be slightly faster. All API functions using strings, such as CreateFile expands to either CreateFileA (ansi) or CreateFileW (unicode). The ansi versions are simply wrappers around the unicode versions, so building in unicode avoids a conversion to unicode.

I wouldn't argue that performance is a good reason for switching to unicode, but it's worth knowing. And I can't think of a good reason to NOT build everything in unicode.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!