File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes BEA/Weblogic and the fly likes Post request doesnot support spanish characters in case of Weblogic + Solaris combination Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » BEA/Weblogic
Bookmark "Post request doesnot support spanish characters in case of Weblogic + Solaris combination" Watch "Post request doesnot support spanish characters in case of Weblogic + Solaris combination" New topic
Author

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

safvan kothawala
Greenhorn

Joined: Jan 22, 2010
Posts: 4
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

Joined: Feb 24, 2006
Posts: 6662
    
    5

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 ?


SCJP 6 articles - SCJP 5/6 mock exams - More SCJP Mocks
safvan kothawala
Greenhorn

Joined: Jan 22, 2010
Posts: 4
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

Joined: Feb 24, 2006
Posts: 6662
    
    5

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

Joined: Jan 22, 2010
Posts: 4
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

Joined: Jan 22, 2010
Posts: 4
It worked !!!

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

<%@ page pageEncoding="UTF-8" %>
Deepak Bala
Bartender

Joined: Feb 24, 2006
Posts: 6662
    
    5

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Post request doesnot support spanish characters in case of Weblogic + Solaris combination