Added page method getCharacterEncoding. CLK-764
git-svn-id: https://svn.apache.org/repos/asf/click/trunk/click@1096514 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/framework/src/org/apache/click/ActionResult.java b/framework/src/org/apache/click/ActionResult.java
index 9e632d4..915b5e4 100644
--- a/framework/src/org/apache/click/ActionResult.java
+++ b/framework/src/org/apache/click/ActionResult.java
@@ -560,20 +560,14 @@
response.setDateHeader("Expires", new Date(1L).getTime());
}
- String localContentType = getContentType();
+ response.setContentType(getContentType());
- if (getCharacterEncoding() == null) {
+ String localCharacterEncoding = getCharacterEncoding();
+ if (localCharacterEncoding == null) {
// Fallback to request character encoding
- if (context.getRequest().getCharacterEncoding() != null) {
- response.setContentType(localContentType + "; charset="
- + context.getRequest().getCharacterEncoding());
- } else {
- response.setContentType(localContentType);
- }
-
- } else {
- response.setContentType(localContentType + "; charset=" + getCharacterEncoding());
+ localCharacterEncoding = context.getRequest().getCharacterEncoding();
}
+ response.setCharacterEncoding(localCharacterEncoding);
}
-}
+}
\ No newline at end of file