You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Greg Hess <gh...@wrappedapps.com> on 2003/04/18 22:28:23 UTC

i18n input forms? BRAIN TWISTER

Hi All,
 
I built a Struts application that provides the ability to build a web
page. The input form allows the client to upload an image and provide
text to be used in the content of the web page.
 
The web pages being edited are within remote Struts apps. My
administrative app displays the form and then builds an XML data
structure containing the image and text and Post's it to the remote web
app. The remote app parses the XML and populates a Java properties file
and saves the image to file. The next time the remote page is requested
the action reads from the properties file and places the text into the
session and allows the jsp to display the custom text. 
 
All is well. :-)
 
Now I have a new client that is entering Latin/French text and all his
"special characters" are not being rendered properly. :-(
 
So to try and support this I have:
 
-          Specified the charset in the administrative page header to
ISO-8859-1
-          Use ISO-8859-1 encoding in my XML document serialization
-          Specified the charset=ISO-8859-1 in the header of the page
being customized
 
My problem is that the characters are not being rendered properly. The
page is using ISO-8859-1 encoding. The strange thing is when I switch to
UTF-8 encoding the characters appear!! I never encoded anything to
UTF-8.
 
When I test within my administrative app all is as expected. I take the
user input build XML DOM serialize DOM, parse DOM and place the values
into the session and display on a page with ISO-8859-1 and the special
characters render fine.
 
I am having a difficulty understanding what is happening when I POST the
XML, parse it and save to properties file that is for some reason
returning UTF-8 encoded characters to my jsp?
 
I have even added a Servlet filter to specify the character encoding to
the ActionServlet of my Administrative app but that changed nothing. 
 
I know you might say hay its working with UTF-8 charset on the
customized page so forget it. I just might even thought I want to
understand what is going on but I also use some of the text to create an
image and that is failing and I am sure it is because of the UTF-8
characters.
 
I am using
 
JDK 1.4
Resin 2.1.2
Xerces
 
Any help is greatly appreciated,
 
Greg