Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Cannot Reproduce
-
Affects Version/s: 7.0.0.pre5
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
-
Environment:server linux Java6u10. browsers: safari, firefox, konqueror.
-
Number of attachments :
Description
I found that that UTF-8 encoded form data is not correctly parsed by request.getParamter.
I had found this bug in servlet. But I made a simple JSP page to demo the problem.
Here is screenshot that demos results
http://img72.imageshack.us/img72/3739/snapshot14.png
File: test.jsp
[CODE]
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<%= request.getParameter("language") %>
<form name='form1' action='test3.jsp' method='post' accept-charset='UTF-8'>
<input type='hidden' id='id_action' name='action' value='do' />
<input type='text' id='id_language' name='language' value='English Русский 北方話 / 官話 北方话 / 官话' />
<input type='submit' id='id_submit' name='Submit' value='' />
</form>
</body>
</html>
[/CODE]
My original servlet had same effect.
response.setCharacterEncoding("UTF-8"); - was the first line in doGet and doPost
/opt/jdk1.6.0_10/bin/java -agentlib:jdwp=transport=dt_socket,suspend=y,address=localhost:35785 -Dfile.encoding=UTF-8 -classpath /home/max/my/workspace/Jetty7/bin:/home/max/my/workspace/Jetty7/start.jar org.mortbay.start.Main