i am using java application and i want to set encoding to UTF-8 using :
request.setCharacterEncoding("UTF-8");
the problem is with the request it is not defined ?!
i am using java application and i want to set encoding to UTF-8 using :
request.setCharacterEncoding("UTF-8");
the problem is with the request it is not defined ?!
This must be set prior to reading request parameters or reading input; therefore if you are doing it after the fact it will have no effect.
In addition if you are using Tomcat you should also set the URIEncoding to UTF-8 within your connectors as noted in this SO answer.
Do you want to specify the response encoding? That's done via the ServletResponse.
response.setContentType("text/html;charset=utf-8");
the problem is with the request it is not defined ?!
By the time your request arrives on the server, it is already encoded in a specific format. You cannot change the request message's encoding at runtime. However you can change the way the encoding is interpreted at runtime using the serCharacterEncoding() method.