title: In Pandas UnicodeDecodeError Cannot decode Unicode Ascii in JSON file using pandas.read_json()
body: <p>Thanks for your help in advance. I am trying to read a JSON file into a pandas DataFrane and getting a cornucopia of unicode/ascii errors.
  Edit: The error appears to lie in the fact that the JSON file is multi line with each line its own JSON object.</p>
  
  <p>With a data file that looks like:</p>
  
  <pre><code>"data.json" = 
  
  {"_i":{"$o":"5b"},"c_id":"10","p_id":"10","c_c":2,"l_c":59,"u":{"n":"J","id":"1"},"c_t":"2010","m":"Hopefully \n\nEDIT: Actually."}
  {"_i":{"$o":"5b"},"p_id":"10","c_id":"10","p_id":"10","c_c":0,"l_c":8,"u":{"n":"S","id":"1"},"c_t":"2010","m":"in-laws?"}
  </code></pre>
  
  <p>Edit: In response to a comment, the above is not code to be run, it is included as a <em>sample</em> of my datafile, that is saved as a json file.</p>
  
  <p>As this is a multiple line file, per this link <a href="https://stackoverflow.com/questions/30088006/loading-a-file-with-more-than-one-line-of-json-into-pythons-pandas">Loading a file with more than one line of JSON into Python&#39;s Pandas</a> I tried to use</p>
  
  <pre><code>import pandas
  df = pandas.read_json('data.json', lines = True)
  </code></pre>
  
  <p>Gives the error:</p>
  
  <pre><code>    json = u'[' + u','.join(lines) + u']'
  UnicodeDecodeError: 'ascii' codec can't decode byte 0xf0 in position 436: ordinal not in range(128)
  </code></pre>
  
  <p>According to this issue highlighted on GitHub <a href="https://github.com/pandas-dev/pandas/issues/15132" rel="nofollow noreferrer">https://github.com/pandas-dev/pandas/issues/15132</a>, this is because:</p>
  
  <blockquote>
    <p>This can happen in Python 2.7 if the default encoding is set to ascii (check sys.getdefaultencoding()). StringIO will convert the input string to ascii when lines=True, resulting in a UnicodeDecodeError because of mixing utf-8 and ascii strings.</p>
  </blockquote>
  
  <p>Their solution is to change the system encoding to <code>utf-8</code> from <code>ascii</code>, however, I understand that this is inadvisable - source:<a href="https://stackoverflow.com/questions/2276200/changing-default-encoding-of-python">Changing default encoding of Python?</a>.</p>
  
  <p>I also tried changing the encoding both to <code>utf-8</code> / <code>ascii</code> within <code>read_json()</code> but to no avail.</p>
  
  <p>How can I successfully read this json file into a pandas DataFrame, preserving the multi-line structure?</p>
  
  <p>Many thanks!</p>