• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Output encoding: UTF-8

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi there! - I'm using a servlet to generate and output a string resulting from an XSLT transformation. The problem is, that in the web browser those ugly "?" marks will appear.

I'm quite experienced with character encodings and XSLT transformations (mainly on Windows - this is on Linux -, using .NET instead of Java, but have used XSLT transformations with Java, too), but this is the first time I'm using this with Java web applications.
Of course, I've set

before outputting the result.

I could, of course, post the code (either in snippets or upload the complete project somewhere), but I thought you wouldn't handle this.
It's, I currently have no clue how to continue... I.e., how to debug this, and where to start.

I would really appreciate some guys to subscribe to this question, and would be willing to post the code, etc., and everything until this issue will be solved.

Thanks, indeed
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to JavaRanch.

A couple of points to investigate:
  • Is the page that arrives in your browser actually in UTF-8?
  • Does the page display correctly if you change the encoding in the browser to something else?
  • Does the font you use in the page contain the characters that appear as "?" ?

  •  
    Bernd Elsner
    Greenhorn
    Posts: 3
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    These are good questions. Thanks.

    Is the page that arrives in your browser actually in UTF-8?


    If I would only know that!!

    I've removed the Java command response.setCharacterEncoding and the HTML tag <meta http-equiv="Content-Type" content="text/html; charset=utf-8">, too, and saved the resulting HTML file, locally.

    In Firefox, after opening the file, the character set is set to UTF-8. When I change that in Firefox's menu, it will not have changed but will still be UTF-8.

    In Opera, the file will display well if I set the encoding to ISO-8859-1.

    That's absolutely strange as my whole system is setup to use UTF-8 per default!

    Does the page display correctly if you change the encoding in the browser to something else?


    Yes, please see above.

    Does the font you use in the page contain the characters that appear as "?" ?


    This is sans-serif, and the page can display correctly.
     
    Bernd Elsner
    Greenhorn
    Posts: 3
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    This problem is solved.

    I believe most of the confusion is due to the fact that I'm still unsure on how to make Tomcat actually reload the webapp from Eclipse.

    Thanks for assisting me!
     
    You save more money with a clothesline than dozens of light bulb purchases. Tiny ad:
    a bit of art, as a gift, that will fit in a stocking
    https://gardener-gift.com
    reply
      Bookmark Topic Watch Topic
    • New Topic