-
-
Save siebertm/1471698 to your computer and use it in GitHub Desktop.
tomcat encoding problem
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# curl http://192.168.10.13:8080/solr/test.jsp --data q=Orthop%C3%A4die | |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> | |
<html> | |
<head> | |
<title>Character encoding test page</title> | |
</head> | |
<body> | |
<p>Data posted to this form was: | |
Orthopädie | |
</p> | |
</body> | |
</html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%@ page contentType="text/html; charset=UTF-8" %> | |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> | |
<html> | |
<head> | |
<title>Character encoding test page</title> | |
</head> | |
<body> | |
<p>Data posted to this form was: | |
<% | |
//request.setCharacterEncoding("UTF-8"); | |
out.print(request.getParameter("q")); | |
%> | |
</p> | |
</body> | |
</html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.... | |
(at the very top) | |
<filter> | |
<filter-name>SetCharacterEncodingFilter</filter-name> | |
<filter-class>org.apache.catalina.filters.SetCharacterEncodingFilter</filter-class> | |
<init-param> | |
<param-name>encoding</param-name> | |
<param-value>utf8</param-value> | |
<param-name>ignore</param-name> | |
<param-value>true</param-value> | |
</init-param> | |
</filter> | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment