Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

_T

Status
Not open for further replies.

Maurader

Technical User
May 8, 2002
59
CA
what is this _T business?? can some1 explain or point to a good explanation? thanks!
 
_T is a macro that when _UNICODE is defined, takes the text within the parens and converts it to 16 bit characters. When _UNICODE is NOT defined, it evaluates to nothing. Using the macro has no effect when unicode is not enabled and therefore does not hurt anything by being there.

If you need more explanation I will be happy to help. just repost.

Matt
 
and unicode is used for displaying text in non-enlish languages?
 
Actually, it can display many languages... including english. Unicode uses the basic ascii character set but expands after that to support 16 bit characters (0-255 equals all 8 bit values). Recently, I wrote an application in Unicode that displays in English,Spanish and Japanese. It is pretty neat. If you have any other questions, please post.

Matt
 
I believe _T is actually interpreted as the L macro if unicode is defined.
 
Don't forget that if you're using the _T macro, you should be using the "T" version of all the string-handling functions like _tprintf, _istalpha, _istdigit, _tchdir, _tcslen, etc.

I don't know, but I suspect that there are wide-character overloads for the C++ cout, cin, etc. functions. Anyone know for sure?

Chip H.
 
yes... there are wide character conversions but as you said, the "t" versions are better because they map to the correct 8bit or 16bit funciton based on UNICODE definition.

Matt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top