title: MongoDB - Unexpected character encodings when using mongoexport
body: <p>I am using mongoexport on a collection that contains foreign characters encoded in utf8 as well as fields with characters mongoexport seems to be encoding (e.g., '&amp;'). What I'm noticing is mongo export does a unicode escape for the '&amp;' characters but leaves characters like 'ü' unescaped. This is posing a problem because I am trying to read this data using Python but am unable to decode it properly since there are two different encodings happening.</p>
  
  <p>For example (mongo query to get record):</p>
  
  <pre><code>db.Military_Handbooks.findOne({_id: ObjectId("5bf61c80e173a2a10b53ad39")}).PRIMARY_AUTHOR
  
  [
    "Dürer, Albrecht",
    [
      [
        "http://ustc.ac.uk/index.php/search/cicero?tm_fulltext=&amp;tm_field_allauthr=Dürer, Albrecht&amp;tm_translator=&amp;tm_editor=&amp;tm_field_short_title=&amp;tm_field_imprint=&amp;tm_field_place=&amp;sm_field_year=&amp;f_sm_field_year=&amp;t_sm_field_year=&amp;sm_field_country=&amp;sm_field_lang=&amp;sm_field_format=&amp;sm_field_digital=&amp;tm_field_class=&amp;tm_field_cit_name=&amp;tm_field_cit_no=&amp;order=",
        " Dürer, Albrecht"
      ]
    ]
  ]
  </code></pre>
  
  <p>Running the following mongoexport command (and this is the same if exported to json):</p>
  
  <pre><code>mongoexport--db ustc --collection Military_Handbooks --type=csv -f=PRIMARY_AUTHOR --limit=1
  "[""Dürer, Albrecht"",[[""http://ustc.ac.uk/index.php/search/cicero?tm_fulltext=\u0026tm_field_allauthr=Dürer, Albrecht\u0026tm_translator=\u0026tm_editor=\u0026tm_field_short_title=\u0026tm_field_imprint=\u0026tm_field_place=\u0026sm_field_year=\u0026f_sm_field_year=\u0026t_sm_field_year=\u0026sm_field_country=\u0026sm_field_lang=\u0026sm_field_format=\u0026sm_field_digital=\u0026tm_field_class=\u0026tm_field_cit_name=\u0026tm_field_cit_no=\u0026order="","" Dürer, Albrecht""]]]"
  </code></pre>
  
  <p>When trying to read this into Python:</p>
  
  <pre><code>In [24]: import pandas
  In [25]: c = pandas.read_csv('Military_Handbooks2.csv')
  In [26]: c.at[1, 'PRIMARY_AUTHOR']
  Out[26]: '["Dürer, Albrecht",[["http://ustc.ac.uk/index.php/search/cicero?tm_fulltext=\\u0026tm_field_allauthr=Dürer, Albrecht\\u0026tm_translator=\\u0026tm_editor=\\u0026tm_field_short_title=\\u0026tm_field_imprint=\\u0026tm_field_place=\\u0026sm_field_year=\\u0026f_sm_field_year=\\u0026t_sm_field_year=\\u0026sm_field_country=\\u0026sm_field_lang=\\u0026sm_field_format=\\u0026sm_field_digital=\\u0026tm_field_class=\\u0026tm_field_cit_name=\\u0026tm_field_cit_no=\\u0026order="," Dürer, Albrecht"]]]'
  In [27]: c.at[1, 'PRIMARY_AUTHOR'].encode().decode('unicode-escape')
  Out[27]: '["DÃ¼rer, Albrecht",[["http://ustc.ac.uk/index.php/search/cicero?tm_fulltext=&amp;tm_field_allauthr=DÃ¼rer, Albrecht&amp;tm_translator=&amp;tm_editor=&amp;tm_field_short_title=&amp;tm_field_imprint=&amp;tm_field_place=&amp;sm_field_year=&amp;f_sm_field_year=&amp;t_sm_field_year=&amp;sm_field_country=&amp;sm_field_lang=&amp;sm_field_format=&amp;sm_field_digital=&amp;tm_field_class=&amp;tm_field_cit_name=&amp;tm_field_cit_no=&amp;order="," DÃ¼rer, Albrecht"]]]'
  </code></pre>
  
  <p>Specs:<br>
  OS: Ubuntu 18.04.1 LTS<br>
  Python: 3.6.7<br>
  MongoDB shell version v3.6.9   </p>