This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JSP and the fly likes utf-8 data with get method not working but post method working. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "utf-8 data with get method not working but post method working." Watch "utf-8 data with get method not working but post method working." New topic
Author

utf-8 data with get method not working but post method working.

zohaib K khan
Greenhorn

Joined: Aug 01, 2012
Posts: 5
Hi,

I am able to get utf-8 data using POST method but GET method giving junk data

I have attached source code.

I need to get utf-8 data from GET method.


-----------------------------

----------------------------


- Thanks
Zohaib.
Sabarish Venkat
Ranch Hand

Joined: Jan 18, 2012
Posts: 136

java Ranch welcomes you zohaib,

Always we need to read any input using the right encoding. This requires that you instruct the ServletRequest object what encoding to use before you read any data from it. Once you read data from the Request, the encoding is set forever.
Try using request.setCharacterEncoding("UTF-8")

might this may help you
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: utf-8 data with get method not working but post method working.
 
Similar Threads
Multipart request problem
how to get utf-8 data from query string in JSP
Fieldset is not working
tiles and <sx:autocompleter>
Fieldset is not working