groovy

the gsp template can not support unicode(utf-8)

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.5.4
  • Fix Version/s: 1.5.5, 1.6-beta-1
  • Component/s: Groovlet / GSP
  • Labels:
    None
  • Environment:
    jdk1.5,Debian/Linux,groovy1.5.4
  • Patch Submitted:
    Yes
  • Number of attachments :
    3

Description

a test gsp file is (chinese encoding):

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>测试页</title>
</head>
<body>
<%
print "groopvy 测试页"
%>
</body>
</html>

After browser the groovy.servlet.TemplateServlet source code,I find that the service method only set the ContentType to "text/html" .There no information about encoding.
So I add the encoding support for it,you can see the attachment(diff format),and you can configure it throgh the web.xml

  1. AbstractHttpServlet.diff
    12/Apr/08 9:40 AM
    0.8 kB
    Ford Guo
  2. GroovyServlet.diff
    12/Apr/08 9:40 AM
    0.6 kB
    Ford Guo
  3. TemplateServlet.diff
    12/Apr/08 9:40 AM
    0.6 kB
    Ford Guo

Issue Links

Activity

Hide
Ford Guo added a comment -

Actually the GroovyServlet has the same problem,so I readjust the code,please see the attachment.

Show
Ford Guo added a comment - Actually the GroovyServlet has the same problem,so I readjust the code,please see the attachment.
Hide
Ford Guo added a comment -

Add the encoding init parameter and the encoding support.

Show
Ford Guo added a comment - Add the encoding init parameter and the encoding support.
Hide
Paul King added a comment - - edited

fixed in trunk and merged onto the 1.5.x branch

Show
Paul King added a comment - - edited fixed in trunk and merged onto the 1.5.x branch

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: