Skip to main content
deleted 55 characters in body
Source Link

Instead of setlocale(LC_ALL, "ru_RU.utf8"), try set console to UTF8 (cp 65001) and redirect output to file. Save the file in UTF-8 without BOM signature encoding.

//Save As UTF-8 without BOM signature
#include<stdio.h>
#include<Windows.h>
int main(){
    SetConsoleOutputCP(65001);
    char *text = "{\"mdl\":\"пользователи\",\"fnc\":\"получитьсписокпользователей\"}";
    printf("%s",text);
}

We can get the valid UTF-8 string using Cyrillic characters:

{"mdl":"пользователи","fnc":"получитьсписокпользователей"}

Instead of setlocale(LC_ALL, "ru_RU.utf8"), try set console to UTF8 (cp 65001) and redirect output to file. Save the file in UTF-8 without BOM signature encoding.

//Save As UTF-8 without BOM signature
#include<stdio.h>
#include<Windows.h>
int main(){
    SetConsoleOutputCP(65001);
    char *text = "{\"mdl\":\"пользователи\",\"fnc\":\"получитьсписокпользователей\"}";
    printf("%s",text);
}

We can get the valid UTF-8 string using Cyrillic characters:

{"mdl":"пользователи","fnc":"получитьсписокпользователей"}

Instead of setlocale(LC_ALL, "ru_RU.utf8"), try set console to UTF8 (cp 65001) and redirect output to file.

//Save As UTF-8 without BOM signature
#include<stdio.h>
#include<Windows.h>
int main(){
    SetConsoleOutputCP(65001);
    char *text = "{\"mdl\":\"пользователи\",\"fnc\":\"получитьсписокпользователей\"}";
    printf("%s",text);
}

We can get the valid UTF-8 string using Cyrillic characters:

{"mdl":"пользователи","fnc":"получитьсписокпользователей"}
Source Link

Instead of setlocale(LC_ALL, "ru_RU.utf8"), try set console to UTF8 (cp 65001) and redirect output to file. Save the file in UTF-8 without BOM signature encoding.

//Save As UTF-8 without BOM signature
#include<stdio.h>
#include<Windows.h>
int main(){
    SetConsoleOutputCP(65001);
    char *text = "{\"mdl\":\"пользователи\",\"fnc\":\"получитьсписокпользователей\"}";
    printf("%s",text);
}

We can get the valid UTF-8 string using Cyrillic characters:

{"mdl":"пользователи","fnc":"получитьсписокпользователей"}