How to write unicode character farsi in c++ in ms-dos?
cout<<"Helo world"<<"سلام جهان";
How to write unicode character farsi in c++ in ms-dos?
cout<<"Helo world"<<"سلام جهان";
You need to convert the string to proper codepage. MS-DOS codepages are named like CP437, with CP followed by three digits. Notice that normally only less than 256 different characters may be displayed and thus many Unicode characters just cannot be shown in text mode.
#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
}