Intel C compiler and L "" prefix

How can I define Russian strings in Intel C compiler? In MSVS 2008, I do this:

_wsetlocale(LC_ALL, L"Russian");
wprintf(L"");

And it works. The ICC does not work.

+3
source share
1 answer

To diagnose the problem, I would check what values ​​these characters get encoded, like during compilation. With some code:

wchar_t *x = L"";
for(int i=0; x[i] != L'\0'; i++)
{
  printf("%02x\n", x[i]);
}

You can change this value "%02x"to "%04x"if sizeof(wchar_t) == 4.

If the values ​​are different, this is probably a compile-time problem when compilers use different encodings to interpret the source files.

> U + 007F , . , escape- Unicode (, L"\u0442\u0435\u043a\u0441\u0442").

+1

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


All Articles