hi i’m communicating between an http client post techniq and a servlet.
if i send english chars there is no problem but if i send in hebrew i get ????? instead of hebrew, and i use UTF-8.
here is the client’s code
HttpPost post = new HttpPost("http://localhost:8080/dropboxweb/Delete");
try {
List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(
3);
nameValuePairs.add(new BasicNameValuePair("fullpath",full.toString()));
nameValuePairs.add(new BasicNameValuePair("filename",name));
nameValuePairs.add(new BasicNameValuePair("user",Config.getInstance().getUsername()));
post.setEntity(new UrlEncodedFormEntity(nameValuePairs));
HttpResponse response = client.execute(post);
and this is the servlet
//response.setContentType("text/html;charset=windows-1255");
//response.setContentType("text/html;charset=UTF-8");
request.setCharacterEncoding("UTF-8");
response.setCharacterEncoding("UTF-8");
final String full_path = request.getParameter("fullpath");
i tried all the optinos in // none worked.
i’m using tomcat 7.
please help
Refer to this, (it helped me)
What can you recommend to just make everything work? (How to use UTF-8 everywhere)
http://wiki.apache.org/tomcat/FAQ/CharacterEncoding#Q3