Hello,
with a JSF application I am having a strange problem regarding file encoding which shows up in the browser: language specific letters (e.g. ä, ö, ß) are not printed correctly. The naming is taken from a file "messages_de.properties". Example: the string "Paßwort" from that file is printed as "Paßwort" in the browser. I verified that the file is utf-8 encoded with "file -I messages_de.properties" (on mac) - even when checked directly on the server and not only in the eclipse workspace.
I am using jboss-as-7.1.0.Final and changed the encoding on the server by
1. adding the following options to $JBOSS_HOME/bin/standalone.conf
JAVA_OPTS="$JAVA_OPTS -Dfile.encoding=UTF-8"
JAVA_OPTS="$JAVA_OPTS -Dsun.jnu.encoding=UTF-8"
Result: boot.log shows the options accordingly.
2. adding the following configuration to $JBOSS_HOME/standalone/configuration/standalone.xml
<system-properties>
<property name="org.apache.catalina.connector.URI_ENCODING" value="UTF-8"/>
<property name="org.apache.catalina.connector.USE_BODY_ENCODING_FOR_QUERY_STRING" value="true"/>
</system-properties>
I am not sure whether that is needed at all.
Further actions:
- I am using eclipse where the encoding is changed completely to utf-8 (but that seems not to be relevant)
- all xhtml files do have the heading <?xml version="1.0" encoding="UTF-8"?>
- unfortunately, I couldn't find a way to capture the network traffic on the loopback device. However, the source code of the generated html page seems to indicate that the special characters already have been send wrong by the server.
I am running out of ideas. What could be the reason for the above problem?
Regards,
Michael