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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:59:13+00:00 2026-05-28T01:59:13+00:00

I’m using the following JSoup code to render this currency: currencySpan.html(€ + currencyFormat.format(estimatedValue)); However

  • 0

I’m using the following JSoup code to render this currency:

currencySpan.html("€" + currencyFormat.format(estimatedValue));

However if you visit http://www.lastcalc.com/pmGgp1QR to see the output of this, it is displaying a ‘?’ where the Euro symbol should be (before the 19.164 value). I see this in both Chrome and Safari.

Why is this symbol not being displayed correctly?

edit: People are pointing out that this isn’t a browser issue, rather the ? is being served up. Basically I’m using JSoup’s Element.html() to set the text (which includes the %euro;), and from there I use JSoup to render it to a string, which is returned to the browser (either directly when the page first loads, or as part of an AJAX JSON call if the page is edited).

This is the code that returns the document (resp is a HttpServletResponse):

resp.setContentType("text/html");
resp.getWriter().append(doc.toString());

edit2: I stuck a System.out.println(currencySpan); in there and sure enough, Java prints:

<span class=" currency">€19.164</span>

The strange thing is that JSoup appears to have converted & euro ; to the actual symbol, yet at some point it’s not getting to the browser.

How do I ensure that the browser is treating what is returned by the servlet as UTF-8?

edit3: Fixed, I answered with the fix below.

  • 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-28T01:59:14+00:00Added an answer on May 28, 2026 at 1:59 am

    Ok, the problem was that the browser wasn’t interpreting the response as UTF-8, fixed with:

    resp.setContentType("text/html; charset=UTF-8");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I have thousands of HTML files to process using Groovy/Java and I need to
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
That's pretty much it. I'm using Nokogiri to scrape a web page what has
For some reason, after submitting a string like this Jack’s Spindle from a text

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.