• 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

Character Encoding and Copyright Character

 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The copyright character, as we know is part of ISO-8859-1 character set. I have an application that reads a file that contains the copyright character. The copyright char is displayed as question mark ("?") on web page even though I have the following:
(1) TOMCAT_OPTS = TOMCAT_OPTS="$TOMCAT_OPTS -Dfile.encoding=ISO8859_1" or
TOMCAT_OPTS = TOMCAT_OPTS="$TOMCAT_OPTS -Dfile.encoding=ISO-8859-1"
(2) My JSP has code:
<%@page contentType="text/plain;charset=iso-8859-1" %>
<%= (String)request.getAttribute("display") %>
<%-- the "display" attribute should contain the copyright character --%>
(3) Our system (FreeBSD) supports ISO-8859-1, since when I do "cat file.txt", or "vi file.txt", copyright character can be displayed.
This problem only occurs in our QA environment. It's working in development environment and in my local machine.
Here is my code that reads the file:

When I do in.readLine() as shown above, what (default) encoding is used to read the file?
Is there any solution to this problem without making everything UTF-8? I dont think our files are encoded as UTF-8, and UTF-8 is not the standards of our company. Besides, ISO-8859-1 is enough, I think, to display the copyright character (character with Hex value A9).
Help would be greatly appreciated.
Thank you very much.
- David
 
Ranch Hand
Posts: 539
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I know this is a really daft point, since from what you've said you clearly know a lot more about encoding and standards than I do, but...
...what font are you using to display on your front-end? Does that character set have the copyright symbol where you expect it to be?
Just a thought.

-Tim
 
david chen
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Tim,
I'm just trying to display the output in plain text (but using a browser), as shown in my JSP. The copyright symbol (character A9 in ISO-8859-1) is displayed properly when I run the servlet/JSP in my PC, and our development box. It just doesnt work in our QA box. I think this is more of a Tomcat or Java configuration, but I'm not that sure.

Regards,
David
 
Tim West
Ranch Hand
Posts: 539
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Oh OK, I understand.
I was thinking that you were accessing the deployment with a different box (and so different browser) between dev and QA. If that was the case, then the browsers may not be rendering the pages with exactly the same font...A lot of "dodgy" fonts don't define all symbols, though it sounds like you're using a pretty standard one so that shouldn't be a problem.
Anyway, good luck with it...one of the more experienced ranchers must have some ideas, surely?!
--Tim
 
reply
    Bookmark Topic Watch Topic
  • New Topic