Skip to content

Commit c067da4

Browse files
author
graeme
committed
fix for GRAILS-1703
git-svn-id: https://svn.codehaus.org/grails/trunk@5776 1cfb16fd-6d17-0410-8ff1-b7e8e1e2867d
1 parent 3a7a3a3 commit c067da4

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/web/org/codehaus/groovy/grails/web/metaclass/RedirectDynamicMethod.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,17 @@ else if(url != null) {
135135
LOG.debug( "Dynamic method [redirect] no URL mapping found for params [" + params + "]" );
136136
}
137137

138+
// The reverse mapping process requires a character
139+
// encoding. We take the one from the request, but if
140+
// that is null, then we default to 'UTF-8'.
141+
String encoding = request.getCharacterEncoding();
142+
if (encoding == null) {
143+
encoding = "UTF-8";
144+
}
145+
138146
String action = actionName != null ? actionName : webRequest.getActionName();
139147
actualUri = attrs.getApplicationUri(request) +
140-
urlMapping.createURL( controllerName, action, params, request.getCharacterEncoding() );
148+
urlMapping.createURL( controllerName, action, params, encoding );
141149

142150
if( LOG.isDebugEnabled() ) {
143151
LOG.debug( "Dynamic method [redirect] mapped to URL [" + actualUri + "]" );

0 commit comments

Comments
 (0)