aspose file tools*
The moose likes Servlets and the fly likes problem in getting Japanese Characters from HttpServletRequest Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "problem in getting Japanese Characters from HttpServletRequest" Watch "problem in getting Japanese Characters from HttpServletRequest" New topic
Author

problem in getting Japanese Characters from HttpServletRequest

priby mathew
Greenhorn

Joined: Jan 28, 2008
Posts: 25
Greetings to all,

I am trying to get the Japanese characters from HttpServletRequest. But I get it as question marks. The following is the code snippet that I use:




In the above code When I display the encoding of the incoming httpServletRequest it is showing as null. So I have set it to UTF-8 encoding.

But when I write it a file, i am getting japanese characters as ???.

ANy help appreciated.

Thanks in advance
Priby
priby mathew
Greenhorn

Joined: Jan 28, 2008
Posts: 25
In the above code, the for loop statement is as follows:



Thanks
priby
Amit Ghorpade
Bartender

Joined: Jun 06, 2007
Posts: 2716
    
    6

Recently there was a similar discussion here.
See if this solves your problem.


Hope this helps


SCJP, SCWCD.
|Asking Good Questions|
priby mathew
Greenhorn

Joined: Jan 28, 2008
Posts: 25
Thanks Amit for your reply

I checked the page that you suggested but they say to set the required encoding as

ServletRequest.setCharacterEncoding(String enc)

which I had already done in my code.

Moreover I am not fetching the Japanese data from a JSP page. Another application is sending the Japanese data to my application.

Thanks
priby
Amit Ghorpade
Bartender

Joined: Jun 06, 2007
Posts: 2716
    
    6

Another application is sending the Japanese data to my application.

Then if you have done the encoding stuff, you need to make sure that the another application has also done it in proper way.

Hope this helps
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: problem in getting Japanese Characters from HttpServletRequest