Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
json decoding error
#11
(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'
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Decoding lat/long in file name johnmcd 4 270 Mar-22-2024, 11:51 AM
Last Post: johnmcd
  json loads throwing error mpsameer 8 590 Jan-23-2024, 07:04 AM
Last Post: deanhystad
  Enigma Decoding Problem krisarmstrong 4 634 Dec-14-2023, 10:42 AM
Last Post: Larz60+
  python requests library .JSON() error mHosseinDS86 6 3,253 Dec-19-2022, 08:28 PM
Last Post: deanhystad
  Read nested data from JSON - Getting an error marlonbown 5 1,310 Nov-23-2022, 03:51 PM
Last Post: snippsat
  flask app decoding problem mesbah 0 2,312 Aug-01-2021, 08:32 PM
Last Post: mesbah
  Decoding a serial stream AKGentile1963 7 8,339 Mar-20-2021, 08:07 PM
Last Post: deanhystad
  JSON Decode error when using API to create dataframe Rubstiano7 4 2,882 Jan-11-2021, 07:52 PM
Last Post: buran
  Empty response to request causing .json() to error t4keheart 1 9,953 Jun-26-2020, 08:35 PM
Last Post: bowlofred
  empty json file error mcmxl22 1 9,985 Jun-17-2020, 10:20 AM
Last Post: buran

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020