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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T17:12:07+00:00 2026-06-17T17:12:07+00:00

I want to parse following code to html code and show in a WebView

  • 0

I want to parse following code to html code and show in a WebView. This works fine, but…

Code to parse:

<img src="http://...jpeg" alt="„Indoor Maps“ von Google" align="left" style="padding-right:5px">\n\n\nEinfachere Navigation in Gebäuden verspricht Indoor Maps von Google. Der Praxis-Test von COMPUTER BILD im Hamburger „Alsterhaus“ verlief aber kurios.<br>Foto: ComputerBILD<br>

attempt 1) Html.toHtml(Code) – The umlauts and quotes of the texts where parsed fine and the img-tag is still valid (quotes). But some img-attributes were removed, like alt and align. Result:

<p><img src="http://...jpeg"> Einfachere Navigation in Geb&#228;uden verspricht Indoor Maps von Google. Der Praxis-Test von COMPUTER BILD im Hamburger &#8222;Alsterhaus&#8220; verlief aber kurios.<br>\nFoto: ComputerBILD<br>\n</p>\n

attempt 2) external library: org.apache.commons.lang3.StringEscapeUtils.escapeHtml4(Code) – All umlauts and quotes where parsed. The img-tag is corrupted by parsing the quotes. Now i can’t show the image on a WebView. The img-tags where not removed. Result:

&lt;img src=&quot;http://...jpeg&quot; alt=&quot;&bdquo;Indoor Maps&ldquo; von Google&quot; align=&quot;left&quot; style=&quot;padding-right:5px&quot;&gt;\n\n\nEinfachere Navigation in Geb&auml;uden verspricht Indoor Maps von Google. Der Praxis-Test von COMPUTER BILD im Hamburger &bdquo;Alsterhaus&ldquo; verlief aber kurios.&lt;br&gt;Foto: ComputerBILD&lt;br&gt;

I know there are a lot of posts of this category, but I can’t find help to parse the html code and don’t "touch" the quotes of attributes. I am stucking.

EDIT

This is the full Html code

    StringBuilder html = new StringBuilder();
    html.append("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">");
    html.append("<html>");
    html.append("<head>");
    html.append("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=ISO-8859-1\">");
    html.append("<title></title>");
    html.append("</head>");
    html.append("<body bgcolor=\"white\" leftmargin=\"0\" topmargin=\"0\">");       
    html.append(CODE AT THE TOP);
    html.append("</body>");
    html.append("</html>");

When I use UTF-8 I got the same result…

webView.loadData(html.toString(), "text/html", "iso-8859-1");

@Christiaan: This is the current result, when i set the unparsed code to WebView

  • 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-17T17:12:08+00:00Added an answer on June 17, 2026 at 5:12 pm

    I’ve found this post, now it works 🙂 Android. WebView and loadData


    myWebView.loadData(myHtmlString, "text/html; charset=UTF-8", null);
    

    This works flawlessly, especially on Android 4.0, which apparently ignores character encoding inside HTML.
    Tested on 2.3 and 4.0.3.

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

Sidebar

Related Questions

I have the following html code like this: <div class="question"> <input class="cross-reference-question-value-id" id="enr_rds_question_ids" name="enr_rds_surv_rdsap_xref[enr_rds_question_id]"
I want to parse the following html code for my iphone application <Html> <body>
In the following HTML, I can parse the table element, but I don't know
I am using JSoup to parse a gb2312 charset page: http://vars.sinaapp.com/u/t/jsoup_output_encoding_issue.html source code: String
I want to parse the following XML document to resolve all entities in it:
I just want to parse the following string up until the END token then
I want to parse a filter string similar to the following: ((Field1 = 'red')
I want to be able to parse the following times using ParseExact() function: 01:02:03
I have XML in the following form that I want to parse with PHP
I want to use an html parser that does the following in a nice,

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.