• 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
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

File encoding configuration in Tomcat

 
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,
I am having problems in reading the copyright character in Tomcat. Aside from passing -Dfile.encoding=ISO-8859-1, is there any place in Tomcat I can set how my application will read/write a text file? I'm currently having weird problem. Please refer to Character Encoding and Copyright Character to see detailed explanation of the problem.
Here's my environment configuration. I have also indicated the system properties:
1. My PC (works fine here)
- file.encoding=ISO-8859-1
- os.name=Windows XP
- os.version=5.1
2. Company's Development Box (works fine here)
- file.encoding=ISO-8859-1
- os.name=Linux
- os.version=2.4.9-e.35
3. QA Box (doesn't work)
- file.encoding=ISO-8859-1
- os.name=Linux
- os.version=2.4.9-e.38smp
Please help.
Thank you very much.
Regards,
David
 
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are the versions of Tomcat between those 3 environments the same?
You're using the same browser on the same machine to access all 3?


Have you tried explicitly setting the following:
<%@ page pageEncoding="ISO-8859-1" %>
<%@ page contentType="text/html;charset=ISO-8859-1" %>

(those are the defaults)

There is also a setting in $CATALINA_HOME/conf/web.xml
The *.JSP servlet is configured by default to use UTF-8 in its generated source files. Control it with the 'javaEncoding' parameter.
 
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 Mike,
All three environments use Tomcat v3.3.1a. There's no conf/web.xml file in our Tomcat folder, I guess this file only exist for version 4x upward. And I'm using the browser on my PC to access webpages from 3 environments.
I have the following code that reads the text file:

And my JSP contains the following code:

Thank you very much.
- David
[ April 08, 2004: Message edited by: david chen ]
 
She's out of the country right now, toppling an unauthorized dictatorship. Please leave a message with this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic