title: Weird encoding problems when parsing CSV with NodeJS
body: <p>I'm having a strange issue which causes my terminal's encoding go nuts, and kinda requires me to restart my IDE every time it happens (I'm using PhpStorm 2017.1.2 on Mac OS X 10.12.4). 
  This project has a lot of dependency on this little parsing function of mine and up until now it worked like a charm, but when I tried to parse a  big csv file (around 150k records), and tried to console.log every row, it starts to 'glitch' around and make my whole terminal (within the ide) totally unreadable. </p>
  
  <p>The CSV file is formatted like this - </p>
  
  <p><strong><em>Token , Ad_Group</em></strong><br>
  N000000000089076 , BCZ MY - Keyword 1 <br>
  N000000000090445 , BCZ SG - Keyword 3<br>
  N000000000089102 , BCZ MY - Keyword 47<br>
  N000000000090115 , BCZ SG - Keyword 33 [Exact]<br>
  N000000000087801 , BCZ AU - Keyword 12 - [Exact]<br>
  N000000000088111 , BCZ CA - Keyword 1 - Phrase<br>
  N000000000090795 , BCZ UK - Kyeword 89 - Phrase<br>
  ..and so on</p>
  
  <p>My parsing function looks like this -</p>
  
  <pre><code>exports.csv_tokens_parse = function(file_name) {
   console.log('starting to parse '+file_name+'...');
  
   Papa.parse(fs.readFileSync(`../dashboard/reports/${file_name}`, {encoding: 'binary'}), 
   {
      step: function (row) {
        console.log(row.data[0][1]); //displaying the ad_groups column
      }
   });
   return file_arr;
  };
  </code></pre>
  
  <p>After running it and going back to the phpstorm's console, i can see that it prints out the first few thousands lines properly, but then something weird happens, and it changes its' printing encoding to something weird and changes my whole shell into it (a screenshot is attached for a better clarification)</p>
  
  <p><a href="https://i.stack.imgur.com/HLDvA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/HLDvA.png" alt="messed up encoding in terminal"></a></p>
  
  <p>The screenshot is after i hit ctrl+c to stop the console.log loop and get back to the terminal.. but my typing encoding has changed as well, and you can see me trying to type a simple 'ls' in it.</p>