What does Microsoft use as the data type for Unicode strings?

I participate in the C ++ learning process and found an article on MSDN here:

http://msdn.microsoft.com/en-us/magazine/dd861344.aspx

In the first code example, one line of code to which my question relates is as follows:

VERIFY(SetWindowText(L"Direct2D Sample"));

More specifically, the prefix L. I have read a little and will correct it if I am mistaken :-), but this is necessary for unicode strings, i.e. To prepare for a long character set. Now that I read about it, I came across another article about arranged string methods in C here http://www.flipcode.com/archives/Advanced_String_Techniques_in_C-Part_I_Unicode.shtml

It says that there are several options, including the inclusion of a header:

#define UNICODE 

OR

#define _UNICODE

C, , , . , :

wchar_t

, :

_TEXT(t)

L

TCHAR 

, , unicode, , ASCII, . , , , Microsoft TCHAR, - wchar_t.

, , Microsoft , exmaple ATL WTL, - - ?

,

+5
4

UNICODE wchar_t. ANSI , .

wchar_t CRT (: wcscmp strcmp). TEXT TCHAR .. , ANSI, UNICODE, , , .

Windows Visual Studio UNICODE , wchar_t .

+12

: TCHAR, _TEXT() _t* (_tcscpy ) - , Microsoft :/p >

  • Windows NT Unicode
  • Windows 95/98/ME ANSI.

, API Windows, , . COM , - Unicode !

"" : , , /undefining UNICODE / _UNICODE .

Windows9x ( ), ANSI Unicode.

, Unicode : , Unicode, wchar_t, UCS-2 ( , 16- ). , .

+5

TCHAR changes its type depending on UNICODE and should be used when you need code that you can compile for UNICODE and not UNICODE.

If you want to explicitly process only UNICODE data, then feel free to use wchar_t.

+1
source

All Articles