I have a Wicket 1.4 app. My .html files are in UTF-8.
But when rendered, the page is doubly-encoded, like if the UTF-8 content was treated as cp1250 and converted to UTF8.
Maven’s pom.xml:
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
...
<plugin>
<inherited>true</inherited>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
<optimize>true</optimize>
<debug>true</debug>
<encoding>utf-8</encoding>
</configuration>
</plugin>
Any ideas what should I check?
Update: I’ve found the answer, see below. However, can I set the default encoding which should be used when reading resources? Setting Within the application is preffered over env vars.
Thanks,
Ondra
org.apache.wicket.settings.Settingshave asetDefaultMarkupEncoding()method, which should do what you want.