Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are wide characters string literals encoded in UTF-16LE?

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.

like image 884
user4582812 Avatar asked Mar 16 '23 08:03

user4582812


1 Answers

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?

like image 84
Johann Gerell Avatar answered Mar 24 '23 00:03

Johann Gerell