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