Im working on a server-client based cpp console application with winsock there are three codes that helps me but they dont work together
SetConsoleOutputCP(CP_UTF8);
SetConsoleCP(CP_UTF8);
setlocale(LC_ALL, "Turkish");
whenever I use setlocale, the codes like cout<<"Şşİi"; works properly but the data I receive from server doesnt show me these special characters properly
If I delete setlocale command cout<<"Şşİi; code doesnt show me these characters but I can read the special characters in data I receive from server.
waiting for your helps.
#Im having a utf-8 problem in cpp console app
9 messages · Page 1 of 1 (latest)
When your question is answered use !solved to mark the question as resolved.
Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.
Remove setlocale(LC_ALL, "Turkish");
And save your source file as UTF-8, right now it's some other encoding, probably
If you're using MSVC, add /utf-8 flag as well
Really sorry for bothering but how can I do these last 2 things you say in visual studio
I'm not sure about the first one, I don't use VS much
The second one is somewhere in the project settings
I fixed everything I really appreciate that bro you prooved that humans are still better than chatgpt 🗿