You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by jk...@apache.org on 2014/08/28 09:24:57 UTC

git commit: TAP5-2293: send the minified resource as an UTF-8 stream regardless of the platform's default encoding

Repository: tapestry-5
Updated Branches:
  refs/heads/master 194849cd1 -> 004a1e8e1


TAP5-2293: send the minified resource as an UTF-8 stream regardless of the platform's default encoding


Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/004a1e8e
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/004a1e8e
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/004a1e8e

Branch: refs/heads/master
Commit: 004a1e8e1de13c0831c6fe153d45e526126491f2
Parents: 194849c
Author: Jochen Kemnade <jo...@eddyson.de>
Authored: Thu Aug 28 09:23:27 2014 +0200
Committer: Jochen Kemnade <jo...@eddyson.de>
Committed: Thu Aug 28 09:23:27 2014 +0200

----------------------------------------------------------------------
 .../internal/webresources/GoogleClosureMinimizer.java         | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/004a1e8e/tapestry-webresources/src/main/java/org/apache/tapestry5/internal/webresources/GoogleClosureMinimizer.java
----------------------------------------------------------------------
diff --git a/tapestry-webresources/src/main/java/org/apache/tapestry5/internal/webresources/GoogleClosureMinimizer.java b/tapestry-webresources/src/main/java/org/apache/tapestry5/internal/webresources/GoogleClosureMinimizer.java
index 766c171..ee6669c 100644
--- a/tapestry-webresources/src/main/java/org/apache/tapestry5/internal/webresources/GoogleClosureMinimizer.java
+++ b/tapestry-webresources/src/main/java/org/apache/tapestry5/internal/webresources/GoogleClosureMinimizer.java
@@ -36,6 +36,9 @@ import java.util.logging.Level;
  */
 public class GoogleClosureMinimizer extends AbstractMinimizer
 {
+
+    private final static String OUTPUT_CHARSET = "utf-8";
+
     private final List<SourceFile> EXTERNS = Collections.emptyList();
 
     private final Request request;
@@ -64,7 +67,7 @@ public class GoogleClosureMinimizer extends AbstractMinimizer
 
         CompilerOptions options = new CompilerOptions();
         options.setCodingConvention(new ClosureCodingConvention());
-        options.setOutputCharset("utf-8");
+        options.setOutputCharset(OUTPUT_CHARSET);
         options.setWarningLevel(DiagnosticGroups.CHECK_VARIABLES, CheckLevel.WARNING);
 
         Compiler compiler = new Compiler();
@@ -79,7 +82,7 @@ public class GoogleClosureMinimizer extends AbstractMinimizer
 
         if (result.success)
         {
-            return IOUtils.toInputStream(compiler.toSource());
+            return IOUtils.toInputStream(compiler.toSource(), OUTPUT_CHARSET);
         }
 
         throw new RuntimeException(String.format("Compilation failed: %s.",