<commit_before>module Cxxproject

  class ProcessHelper

    def self.readOutput(sp, rd, wr)
      wr.close
        
      consoleOutput = ""
      while not rd.eof? 
        consoleOutput << rd.read_nonblock(1000)
      end
        
      Process.wait(sp)
      rd.close
      
      consoleOutput
    end

  end

end<commit_msg>fixed non-ascii char console prob in windows<commit_after>module Cxxproject

  class ProcessHelper

    def self.readOutput(sp, rd, wr)
      wr.close
        
      consoleOutput = ""
      while not rd.eof? 
        consoleOutput << rd.read_nonblock(1000)
      end
        
      Process.wait(sp)
      rd.close
      
      # seems that pipe cannot handle non-ascii characters right on windows (even with correct encoding)  
      consoleOutput.gsub!(/\xE2\x80\x98/,"`") # 
      consoleOutput.gsub!(/\xE2\x80\x99/,"'") # 
      
      consoleOutput
    end

  end

end
{'fraction_non_alphanumeric': 0.08748615725359911, 'fraction_numerical': 0.019933554817275746, 'mean_word_length': 1.8881789137380192, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6622708', 'n_tokens_mistral': 307, 'n_tokens_neox': 276, 'n_words': 66}