File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Soft Skills: The software developer's life manual this week in the Jobs Discussion forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Post request doesnot support spanish characters in case of Weblogic + Solaris combination

 
safvan kothawala
Greenhorn
Posts: 4
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am passing a spanish character in post request.
The "file.encoding" of JVM is UTF-8.
I am also setting the encoding of request and response as UTF-8.

I am getting a junk character in place of accentuated character in the response.

Please help.
 
Deepak Bala
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is the response a web page ? Do you see the problem only with weblogic + solaris ? How are you confirming that the request header has the UTF-8 encoding type ?
 
safvan kothawala
Greenhorn
Posts: 4
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Deepak Bala wrote:Is the response a web page ? Do you see the problem only with weblogic + solaris ? How are you confirming that the request header has the UTF-8 encoding type ?


The response is a web page.

I have tested this with Jboss + Windows combination and it works fine.

I have set encoding of request and response objects in jsp. Following things i have done in jsp:

<META HTTP-EQUIV="content-type" CONTENT="text/html; charset=UTF-8">
request.setCharacterEncoding("UTF-8");
response.setContentType("text/html; charset=utf-8");
 
Deepak Bala
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use a debugging proxy and determine if the headers propagate to the JSP page correctly. Compare the headers in both cases and let us know the differences you see.

I use this proxy to analyze requests -> www.charlesproxy.com/
 
safvan kothawala
Greenhorn
Posts: 4
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Deepak,
I verified the request headers using the tool.

The only difference was in the Content-Type attribute.

Windows:
Content-Type: text/html;charset=UTF-8

Solaris:
Content-Type: text/html;charset=ISO-8859-1

I have set the charset as "UTF-8" in jsp even though it is giving me "ISO-8859-1"

 
safvan kothawala
Greenhorn
Posts: 4
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It worked !!!

I have to give the following snippet on each jsp page.

<%@ page pageEncoding="UTF-8" %>
 
Deepak Bala
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Glad to hear that. As you had diagnosed with the tool, the character encoding was not set to UTF-8 when the page was displayed.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic