Python Forum

Full Version: json decoding error
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
(Mar-22-2023, 08:09 PM)deneme2 Wrote: [ -> ]it gave same error
It does not give the same error. Running on windows:
import json

with open("1.json", "r") as file:
    json.load(file)
Error:
UnicodeDecodeError: 'charmap' codec can't decode byte 0x90 in position 9680: character maps to <undefined>
With encoding=utf-8
import json

with open("1.json", "r", encoding="utf-8") as file:
    json.load(file)
No errors.

if you are interested, this is the file contents surrounding position 9680
Quote:b'mpName":"USSR. 3x3. Division \xd0\x90","opp1":"Brazil (3'
Pages: 1 2