Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9082587
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T20:35:41+00:00 2026-06-16T20:35:41+00:00

The JSON data I’m getting back from an API call has a character in

  • 0

The JSON data I’m getting back from an API call has a character in it \x96

It’s causing the following error when I make the API call:

'ascii' codec can't encode character u'\x96' in position 56: ordinal not in range(128)

This happens occasionally with the API calls — maybe 5% of the time when there is I guess this unicode data it can’t decode. Any idea how to decode these characters?

Here’s my code:

    start = str(start)
    limit = str(limit) 
    if sort_by:
        url = self.base_url + specific_url + "?q=" + str(query) + "&filters=[[%22category_id%22,[" + category_id + "]]]" + "&start=" + start  + "&limit=" + limit + "&sortby=" + sort_by + "&apikey=" + self.api_key 
    else:
        url = self.base_url + specific_url + "?q=" + str(query) + "&filters=[[%22category_id%22,[" + category_id + "]]]" + "&start=" + start  + "&limit=" + limit + "&apikey=" + self.api_key

    response_json = self.web_fetch(url)
    return simplejson.loads(response_json)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T20:35:42+00:00Added an answer on June 16, 2026 at 8:35 pm

    simplejson.loads must take a unicode object for this to work.

    This means that you need to amend the web_fetch() function to return a Unicode object, or you can just decode response_json as UTF8 if you know that that is its encoding.

    response_json = response_json.decode('utf-8')
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Following is the json data which i am getting from an api { list:
i'm getting json data from the facebook-graph-api about: my relationship with my friends my
I am getting json data as a response back from the server. I want
I am using json data received from server to display images. I am getting
I have a Json data retrieved from facebook using graph api, now i am
While fetching json data I am getting error: JSONArray cannot be converted to JSONObject
The json data object below is what's returned from a custom Google search API
I'm getting json data from a website.. but in the data there is single
I am getting JSON data from a web service and would like to display
Given the following JSON data: [ { pk: 2, model: corkboard.announcement, fields: { body:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.