The standard C++ way that would work even if the console does not support Unicode would require a locale:
1 2 3 4 5 6 7 8 9
#include <iostream>
#include <locale>
#include <clocale>
int main()
{
std::wcout.imbue(std::locale("en_US.utf8")); // any Unicode locale works
std::setlocale(LC_ALL, "en_US.utf8"); // extra setup to satisfy C I/O subsystem
std::wcout << L"میں اردو نہیں بولتا\n";
}
But if you're using the Windows console, it is slightly more complicated: Windows does not support Unicode except through proprietary WinAPI functions, and in fact does not support any multibyte locales. There are several ways to do that that you should find by a web search. The simplest is probably to use wide strings and set standard output to _O_WTEXT
1 2 3 4 5 6 7 8
#include <iostream>
#include <io.h>
#include <fcntl.h>
int main()
{
_setmode(_fileno(stdout), _O_WTEXT);
std::wcout << L"میں اردو نہیں بولتا\n";
}
that makes it print میں اردو نہیں بولتا , although if your console does not have a font that can show it, you may have to redirect the output to a file and load it in notepad to see the characters.