Jump to content
  • Advertisement

Archived

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

The big Question?

UNICODE: Why not use TCHAR instead of CHAR?

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

Well I´ve been around this board for a while, and nobody seems to be concerned about UNICODE which is character-set for Win2000/NT, where ANSI is the character-set for Win95/98. Everbody, I´ve seen, uses LPSTR/CHAR instead of PTSTR/TCHAR, which forces Win2000 to convert every character from ANIS into UNICODE, which is VERY SLOW. Now the question is: Why don´t you people, program with Win2000 and UNICODE in mind? Don´t you like Win2000 (-: ??? Because it can´t be so hard to replace CHAR with TCHAR and PSTR with PTSTR, and then write: #define UNICODE // in the header-file -Hope somebody will answer, because I don´t get it.

Share this post


Link to post
Share on other sites
Advertisement
I think that may because none of us wants to create a NT/2000 build as well as a Win9x build. And seriously, in game development, how many times do you call Windows API calls on a string? Unless you do it every frame, it doesn''t really matter.

Share this post


Link to post
Share on other sites
Honestly, getting into the habit of writing Unicode compatible code is a good one to get into. This will really help your code portability in the future.

quote:
Original post by SiCrane

And seriously, in game development, how many times do you call Windows API calls on a string? Unless you do it every frame, it doesn''t really matter.


Yeah, you''d think that, but some of my recent experiences have proven otherwise. Recently, I starting working on a port of a game from the PC to the Dreamcast (which can use WinCE). You wouldn''t believe the amount of problems we have ran into. Not only was the amount of code to change quite a bit larger than expected, some extremely nasty errors were coming up from missed changes and memory overwrites (Unicode is 2 bytes per character).

All in all, several weeks were invested in either code changes or bug tracking that could have been avoided by simply using the generic mappings that are availible when the original code was produced.

Share this post


Link to post
Share on other sites
quote:
Original post by SiCrane
I think that may because none of us wants to create a NT/2000 build as well as a Win9x build. And seriously, in game development, how many times do you call Windows API calls on a string? Unless you do it every frame, it doesn''t really matter.


No but still if you later on want to convert some of your code to Win2000 (or Win2002 at that time), it is much easier just to #define UNICODE, than editing though a whole game and replacing CHAR with TCHAR and so on.

And ANSI is dead while UNICODE is the furture of Windows,
so can´t damage to write clever which is aware of the furture (:

Share this post


Link to post
Share on other sites
quote:

No but still if you later on want to convert some of your code to Win2000 (or Win2002 at that time), it is much easier just to #define UNICODE, than editing though a whole game and replacing CHAR with TCHAR and so on.

And ANSI is dead while UNICODE is the furture of Windows,
so can´t damage to write clever which is aware of the furture (:



What do Linux programmers do? Do I have to worry about this??

Share this post


Link to post
Share on other sites
I don´t know what Linux uses, but there must be some Linux fan out there who knows.

Another reason I can think of why people should use unicode is that unicode supports almost all character-formats in the world.
Now you can use the same sourcecode for a game in Japan as you would use for a game in USA.
This could save a lot of time in translation of games/apps from USA-english to One of the far-eastern languages.

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!