error while parsing JSON file, probally a hidden value on the JSON content


I have this JSON file:

Looks normal at first, even using online json schema validators
However when parsing it locally, I get error.
I tried it with python, nodejs and golang but It’s not working.
I think it probably has some hidden value that make impossible to parse it

Asked By: John Balvin Arias



here is the complete solution. comments added against the code.

# read the file as bytes
import chardet
import json
with open (file_path , "rb") as f:
    data= # read file as bytes
file_encoding=chardet.detect(data)['encoding'] # detect the encoding
print(f"file(bytes) encoding:{file_encoding}") # print encoding

json_data = json.loads(data.decode(file_encoding)) # decode the bytes and load the json data


file(bytes) encoding:UTF-16
{'group': 'Slot',
 'group_order': 1,
 'positions': [{'group': 'Slot',
   'position': 'SLWR',
Answered By: simpleApp
Categories: questions Tags: , , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.