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

  • SEARCH
  • Home
  • 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 8701441
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T02:23:54+00:00 2026-06-13T02:23:54+00:00

Currently I’m working on calling a JSON feed (from an URL) from within an

  • 0

Currently I’m working on calling a JSON feed (from an URL) from within an Android application. Calling this URL is no problem, but I’m having a really annoying issue with my JSON output. Yesterday my JSON was working fine, but when I made a call to it today I’m getting an error that my string cannot be converted to a JSON object.

I printed the result to the console and the JSON string looked just fine.

{"message":{"success":false,"error":22}}

However, using the substring() method to obtain only the first character of the string, the output was:

·

I’m assuming this is an encoding issue, but I’m giving the following headers to my JSON feed:

content-type: application/json; charset=utf-8

I’m using the Yii-framework method CJSON::encode() to encode the data to JSON. It has always worked on me, until this morning. I set all my encoding to utf-8, but with no avail.

I also called to the JSON-feed from my browser, copied the JSON and used an online JSON validator, which gave me an ‘Invalid JSON’ result on the first line which is the ‘{‘ bracket. I removed the bracket and manually added it, validated the JSON again and the validator gave a ‘Valid JSON’ result.

  • 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-13T02:23:56+00:00Added an answer on June 13, 2026 at 2:23 am

    Are you using PHP end tag ?> on all your custom PHP files?

    if so, remove the end tag. It is optional in PHP. And make sure that PHP open tag <?php always start at top of the file without any spaces in your classes/models/controllers.

    They create this kind of special characters, because after the end tag whatever you put will be a output to the client. NOT all PHP editors show special characters they may just display some blank space.

    <?php
        echo "Hello, World,";
    
    ?>
    __//Here is a special character, but editor unable to display it.
    

    one way to debug is … use ob_start() ob_end_clean()

    • simply add ob_start() on top of the front script … i.e. add it in index.php

    • and before your CJSON::encode() clean the buffer using ob_end_clean()

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Currently I use /etc/init.d/supervisor restart but this restarts all processes under supervisor. Is there
Currently i am consuming web service from android by the method SOAP.Here i need
Currently I am debugging the signing of an Android app. And this would be
currently I'm developing an app for WP7 but came across a little problem with
Currently I am working in message compose screen in Android, Using Intent to show
I am currently running into a problem where an element is coming back from
Currently i am working simple PayPal integration in Android, So i set the Manifest.xml
Currently, I am writing a MiddleWare application that synchronizes information between and accounting application
Currently I'm starting a new Activity and calling finish on a current one. Is
Currently, I'm working on a project where I have a server - client relationship

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.