A
A
Alexey Poloz2017-07-26 18:50:48
Python
Alexey Poloz, 2017-07-26 18:50:48

Python How to fix encoding in file for JSON?

Filled a JSON file with data using Python on Windows.
When I transferred it to MacOS, I fixed the encoding to UTF8 and began to parse this file, but an error appeared:

json.decoder.JSONDecodeError: Unexpected UTF-8 BOM (decode using utf-8-sig): line 1 column 1 (char 0)

How to fix?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Cheremisin, 2017-07-26
@kosyachniy

I also figured it out a month ago - https://stackoverflow.com/questions/13156395/pytho...
But really just save json in correct UTF-8.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question