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 3308466
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T21:31:29+00:00 2026-05-17T21:31:29+00:00

I am downloading a JSONObject from a web site. The entries are however HTML-encoded,

  • 0

I am downloading a JSONObject from a web site. The entries are however HTML-encoded, using

" 

and

&

tags. Is there an easy way to get these to Java strings? Short of writing the converter myself, of course.

Thanks RG

PS: I am using the stuff in a ListView. Probably I can use Html.fromHTML as I can for TextView. Don’t know.

  • 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-05-17T21:31:30+00:00Added an answer on May 17, 2026 at 9:31 pm

    OK, I simply went to write my own quick fix. Not efficient, but that’s OK for the purpose. A 5-minutes-solution.

    public static String unescape (String s)
    {
        while (true)
        {
            int n=s.indexOf("&#");
            if (n<0) break;
            int m=s.indexOf(";",n+2);
            if (m<0) break;
            try
            {
                s=s.substring(0,n)+(char)(Integer.parseInt(s.substring(n+2,m)))+
                    s.substring(m+1);
            }
            catch (Exception e)
            {
                return s;
            }
        }
        s=s.replace("&quot;","\"");
        s=s.replace("&lt;","<");
        s=s.replace("&gt;",">");
        s=s.replace("&amp;","&");
        return s;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When downloading a file from a Web Site, speeds of many megabytes per second
I am downloading images using the NSURLConnection sendSynchronousRequest method and that works fine. However,
I'm currently downloading an HTML page, using the following code: Try Dim req As
Task Downloading binary files from a remote media processing server to a web server.
Scenario Downloading an xlsx file to my local drive from a http location using
i am downloading data from website using asynctask and my code for async task
I am downloading images from web and i use Gallery widget to display the
I'm downloading a web page (tag soup HTML) with XMLHttpRequest and I want to
I'm downloading an entire directory from a web server. It works OK, but I
I'm Downloading stock prices from Yahoo for the S&P500, which has volume too big

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.