Changeset 36326


Ignore:
Timestamp:
2022-07-28T23:26:24+12:00 (2 weeks ago)
Author:
davidb
Message:

More careful saving of JSON as UTF8, without the \u being used

File:
1 edited

Legend:

Unmodified
Added
Removed
  • other-projects/bib-stinky/trunk/doi-stinky/oacore-get-doi.py

    r36325 r36326  
    9595   
    9696    returned_json = getDOI(doi)
    97     returned_json_prettyprint = json.dumps(returned_json, indent=2)
    98      
    99     print(returned_json_prettyprint)
     97    returned_json_prettyprint = json.dumps(returned_json, indent=2, ensure_ascii=False)
    10098
     99    print("Saving returned JSON output to: " + json_output_filename)
     100
     101    with open(json_output_filename, 'w', encoding="utf8") as fout:
     102        fout.write(returned_json_prettyprint)
    101103
    102104   
Note: See TracChangeset for help on using the changeset viewer.