title: Is there any way for Pandas' read_csv C engine to ignore or replace Unicode parsing errors?
body: <p>Most questions around reading strings from disk in Python involve codec issues. In contrast, I have a CSV file that just flat out has garbage data in it. Here's how to create an example:</p>
  
  <pre><code>b = bytearray(b'a,b,c\n1,2,qwe\n10,-20,asdf')
  b[10] = 0xff
  b[11] = 0xff
  with open('foo.csv', 'wb') as fid:
      fid.write(b)
  </code></pre>
  
  <p>Note that the second row, third column has two bytes, <code>0xFF</code>, which don't represent any encoding, just a small amount of garbage data.</p>
  
  <p>When I try to read this with <a href="https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.read_csv.html" rel="nofollow noreferrer"><code>pandas.read_csv</code></a>:</p>
  
  <pre><code>import pandas as pd
  df = pd.read_csv('foo.csv') # fails
  </code></pre>
  
  <p>I get an error, naturally:</p>
  
  <pre><code>  File "pandas/_libs/parsers.pyx", line 881, in pandas._libs.parsers.TextReader.read
    ...
    File "pandas/_libs/parsers.pyx", line 1520, in pandas._libs.parsers._string_box_utf8
  UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte
  </code></pre>
  
  <p>I can however successfully read this file if I use Pandas' Python CSV engine:</p>
  
  <pre><code>df2 = pd.read_csv('foo.csv', engine='python') # success
  </code></pre>
  
  <p>In this case, the invalid characters are replaced with <code>U+EFBF</code> characters that Unicode uses to represent "Invalid Character"s.</p>
  
  <p><strong>Question:</strong> is there any way for Pandas' C CSV engine to do the same thing as Python's here?</p>