I am sending a response using the following code:
response.setHeader("Content-Encoding","UTF-8");
response.setContentType("text/plain charset=UTF-8");
PrintWriter outWriter = response.getWriter();
String returnString = new String(dataController.translateFile(documentBuffer).getBytes(), "UTF-8");
outWriter.print(returnString);
When I run my web app using tomcat 6.0.29 on Eclipse, the resulting txt file gives me a txt file with utf-8 encoding (I can see a lot of arabic or chinese symbols without problem), however once I deploy the WAR file of the project, the resulting txt file is filled with question marks instead of chinese or arabic characters.
Any idea of what might be the problem?
Also I added URIEncoding="UTF-8"
on each Connector tag in the server.xml file from CONF/ of Tomcat. The same tomcat Eclipse is using but to no avail.
Thanks in advance!