Console issuing output in a different text format

I am doing my job, but suddenly, while reading data from a file, I suddenly came across text in a different form. I also did a little test to see if this is my code error or if Visual Studio 2012 is crazy. I am also debugging, but the values ​​in the string "] []" are going right. But I found a little test still giving me the same thing: here is my little code test:

file: input.txt { value := (rate * dollar) + (rate1 * dollar1); totalvalue := value / 2; t1 = ivariable > 10 && ivariable < 100 { value := (rate * dollar) + (rate1 * dollar1); totalvalue := value / 2; } } 

code:

 #include <sstream> #include <fstream> using namespace std; void main(){ const int si = 1500; string line[si]; ifstream infile; infile.open("input.txt"); cout<<"Reading"<<endl; // infile>>data; // cout<<data<<endl; int a=0; int size=0; // string line[1500]; // for (int i=0;i<10;i++){ while(!infile.eof()){ getline(infile,line[a],'\n'); cout<<line[a]<<endl; a++; } } 

and conclusion: enter image description here

Any idea please share ......

+6
source share
2 answers

It looks like you copied some text from pdf or from Adobe or Nitro and pasted it into notepad as .txt. Never do things that always try to either write on their own or use the Notepad editor. I also encountered this situation when compiling. My teacher gave me the data in a pdf file and I copied it. Sorry for the late reply, I read bright comments and I laugh that he is you ... Good luck!

+4
source

Your input.txt is Unicode encoded, but your console is not configured to display Unicode.

Save the file as regular ASCII.

+2
source

Source: https://habr.com/ru/post/982855/