1. Add an L to the front of the string:
For example, l "my string" indicates converting an ANSI string to a unicode string, that is, each character occupies two bytes.
Strlen ("ASD") = 3;
Strlen (L "ASD") = 6;
2. The _ t macro can enclose a string enclosed by quotation marks. Based on your environment settings, the compiler selects an appropriate (UNICODE or ANSI) Character Processing Method Based on the compiling target environment.
If Unicode is defined, the _ t macro adds an L to the front of the string. In this case, _ T ("ABCD") is equivalent to L "ABCD", which is a wide string.
If not defined, the _ t Macro will not add the L before the string. _ T ("ABCD") is equivalent to "ABCD"
3. Text, _ text and _ t are the same
See the following three statements:
Tchar szstr1 [] = text ("str1 ");
Char szstr2 [] = "str2 ";
Wchar szstr3 [] = L ("str3 ");
The first sentence is interpreted as the third sentence when Unicode is defined. If no definition is made, it is the second sentence.
However, whether Unicode is defined or not, an ANSI string is generated, and the third sentence is always a unicode string.
We recommend that you use the first representation for program portability.
However, in some cases, a character must be ANSI or Unicode.