You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Jon Mann (JIRA)" <ji...@apache.org> on 2015/10/28 15:58:27 UTC

[jira] [Created] (WICKET-6012) Confused character encodings in JavaScriptPackageResource and CssPackageResource

Jon Mann created WICKET-6012:
--------------------------------

             Summary: Confused character encodings in JavaScriptPackageResource and CssPackageResource
                 Key: WICKET-6012
                 URL: https://issues.apache.org/jira/browse/WICKET-6012
             Project: Wicket
          Issue Type: Bug
          Components: wicket
    Affects Versions: 6.20.0
         Environment: Windows server
Tomcat 7
Wicket 6.20.0
            Reporter: Jon Mann


We encountered a character encoding problem with a Javascript resource provided by Wicket 6.20.0 from our application hosted by Tomcat 7 on a Windows server (with a JVM default charset of "windows-1252").

The source Javascript resource is UTF-8 encoded with a leading BOM mark. The leading bytes of the resource received by the browser are broken.

We tested several different solutions which all worked (with various consequences):

1. Remove the BOM mark from the source Javascript file
2. Set the JVM "file.encoding" property to "UTF-8".
3. Disable DefaultJavaScriptCompressor in Wicket
4. Change the code in JavaScriptPackageResource to "return output.getBytes("UTF-8")"

We solved this problem using solution #1.

We think you should consider changing the code in  JavaScriptPackageResource and CssPackageResource per solution #4.

Please see the attached images and an example quickstart test case (which demonstrates the problem on my Windows machine where the JVM default character encoding is "windows-1252").

Thanks to the Wicket team for a great framework.




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)