Are L'A 'and' A 'really the same?

When we write a program that supports both unicode and multibytes,
we often use the _T ("some string") macro for strings.

But should the character also wrap this macro?

Are L'A 'and' A 'exactly the same?
Don't we need to wrap _T ('A') for a character?

+3
source share
4 answers

If you write 'A', and this value is converted to wchar_t, then, at least in Microsoft compilers, it will have the same meaning as if you wrote L'A'or _T('A').

, const char* const wchar_t*. , , , , .

, - , - , - . , , 'A', L'A'. , , wchar_t, 'A'.

, , L'A' == (wchar_t)'A', , Microsoft, - . , , Unicode ISO-8859-1. , "", , , " ".

+3

, L'A ' unicode char wchar_t, ' A ' ASCII char char. MSDN .

+5

L'A '- wchar_t,' A '- char. , .

_T ('A'), L , _UNICODE.

+1

_T - Visual Studio, Character Set "Use Multi-Byte characters" _T , "Use Unicode Character Set" _T L. Unicode- > ASCII - .

0

Source: https://habr.com/ru/post/1737313/


All Articles