How to write unicode character farsi in c++ in ms-dos?
cout<<"Helo world"<<"سلام جهان";
#include <iostream>
#include <locale>
#include <string>
int main()
{
using namespace std;
wstring wcs = L"中文";
locale old = wcout.imbue(locale("") ); // "" is environment's default locale
wcout<<wcs<<endl;
wcout.imbue(old ); // restore old locale
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With