When I output a file with standard ofstream it shows ASCII\ANSI encoding in Notepad++ which is I think normal, but I need this in UCS-2 LE w/o BOM. I don't know what I should change in this code - can you help?
It's an message file format(.vmg) with character encoding in UCS-2 LE w/o BOM n thats what i want to create in c++.
#include <iostream>
#include <fstream>
#include <sstream>
using namespace std;
int main()
{
double i,j;
stringstream sstream;
cout<<"Number Start from:";
cin>>i;
cout<<"\nNumber ends in:";
cin>>j;
for(i;i<=j;)
{
sstream <<i<<".vmg";
string ss = sstream.str();
ofstream sout(ss.c_str());
sout<<"BEGIN:VMSG"<<'\n'<<"VERSION:1.1"<<'\n'<<"X-IRMC-STATUS:"<<'\n'<<"X-IRMC-BOX:INBOX"<<'\n'<<"X-NOK-DT:20101224T190106Z"<<'\n'<<"X-MESSAGE-TYPE:SUBMIT"<<'\n'<<"BEGIN:VCARD"<<'\n'<<"VERSION:3.0"<<'\n'<<"N:"<<'\n'<<"TEL:"<<'\n'<<"END:VCARD"<<'\n'<<"BEGIN:VENV"<<'\n'<<"BEGIN:VCARD"<<'\n'<<"VERSION:3.0"<<'\n'<<"N:"<<'\n'<<"TEL:6969"<<'\n'<<"END:VCARD"<<'\n'<<"BEGIN:VENV"<<'\n'<<"BEGIN:VBODY"<<'\n'<<"Date:24.12.2010 19:01:06"<<'\n'<<"bid "<<i<<'\n'<<"END:VBODY"<<'\n'<<"END:VENV"<<'\n'<<"END:VENV"<<'\n'<<"END:VMSG"<<endl;
sstream.str("");
i=i+0.01;
}
return 0;
}