Hey Julien --

I've created a test to demonstrate the problem. Please
add this to your default set of test cases and fix the
TestContext problem!

1. 
jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/CharsetTest.java
  This is my test case. It will have different results when run on different
  machines due to the platform-specific use of String.getBytes() that it
  tests. At least one test should fail on all platforms (the euro test).

2. jwebunit-commons-tests/src/main/resources/testcases/charset.html_utf-8
  This is a text file encoded with UTF-8. When you edit this file, make sure
  to set the character set to UTF-8 to get the euro character to show up. I
  recommend JEdit, it's pretty smart with character sets. If you make changes,
  be very careful with the character set. Some editors will try to change the
  character set and corrupt the file.

3. To configure your test setup of Jetty to serve UTF-8 files, please
 add the following lines to JettySetup.java, right after the line
 with "new WebAppContext()":
        MimeTypes mimeTypes = new MimeTypes();
        mimeTypes.addMimeMapping("html_utf-8", "text/html; charset=UTF-8");
        wah.setMimeTypes(mimeTypes);
Since I've used the extension "html_utf-8" this won't conflict
with your other tests that will continue to run with no encoding specified.

Thanks,
Jesse

PS - In case you're interested, I discussed this problem on my blog
 last night and linked your project. http://publicobject.com/

Attachment: jwebunit-charset-test.tar.gz
Description: GNU Zip compressed data

_______________________________________________
Jwebunit-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jwebunit-users

Reply via email to