Z
Z
Zadavatel_Voprosov2018-09-08 02:16:20
C++ / C#
Zadavatel_Voprosov, 2018-09-08 02:16:20

Does the program work correctly in Debug mode, but doesn't work in release mode?

Hello everyone, the problem is this: when you compile the code in the debug profile, it works fine, but the text is not displayed in the release profile, but it does the main thing (changes the title of the console).
What to do?
Here is the code:

#include "stdafx.h"

wchar_t OriginalTitle[5000];
wchar_t MyTitle[5000] = L"Супир тайтэль (я нассаль на двигатэль)";

int main(void)
{
  _wsetlocale(LC_ALL, L"ru_RU.UTF-8");
  setlocale(LC_ALL, "ru_RU.UTF-8");
  GetConsoleOriginalTitleW(OriginalTitle, 5000);
  wprintf(L"Я получил оригинальный тайтл!\nВот: '%s'\n\n", OriginalTitle);
  SetConsoleTitleW(MyTitle);
  wprintf(L"Я сменил оригинальный тайтл на: '%s'!\n", MyTitle);
  system("pause");
}

bandicam-2018-09-08-02-19-24-639.gif

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Z
Zadavatel_Voprosov, 2018-09-08
@Zadavatel_Voprosov

_wsetlocale(LC_ALL, L"Russian");
setlocale(LC_ALL, "Russian");
And it worked.)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question