Say I have the following:
wchar_t *str = L"Hello World!";
Is L"Hello World!"
encoded in UTF-16LE or UTF-16BE?
Note: I am using Visual C++ 2010.
Say I have the following:
wchar_t *str = L"Hello World!";
Is L"Hello World!"
encoded in UTF-16LE or UTF-16BE?
Note: I am using Visual C++ 2010.
You can safely assume that any wide character string on Windows uses little endian UTF-16 - see this answer for a more elaborate dive: Can I safely assume that Windows installations will always be little-endian?
Depends on your editor, VS2010 uses UTF-8 by default :) With a BOM so the compiler can tell. It can be changed, click the arrow on the Save button.
The compiler will turn it into UTF-16LE in the object file, there are no remaining big-endian machines supported by msvc++ that I know of, ARM cores all run little-endian these days.