0 Replies Latest reply on Jan 27, 2004 7:27 AM by sjpicq

    Can't set JSP content type to UTF-8

    sjpicq

      Hi,

      In our attempt to perform the i18n of our application, we specified the content type of our JSP canvas page (included by all the other JSPs), as UTF-8:
      <%@ page contentType="text/html; charset=utf-8"
      pageEncoding="utf-8" %>

      Then all our property files are transformed into UTF-8 format (using the native2ascii tool from sun).

      This works perfectly well for Bea Weblogic.

      However, under JBoss (v3.2.1), trying to display a simple UTF-8 character doesn't seem to work:
      For instance, out.println("\ufffd"); in the JSP results in a '?' in the html page.

      It seems that the content-type of the http header is not properly set to UTF-8. Are their other settings under JBoss we need to do ?

      Searching in the forum, we found out that other settings might be necessary:

      "Also there's one setting you can define in JAVA_OPTS for Java of JBoss and CATALINA_OPTS for embedded Tomcat:
      In JAVA_OPTS and CATALINA_OPTS add -Dfile.encoding=ISO-8859-2"

      Setting the environment variable CATALINA_OPTS to "-Dfile.encoding=utf-8" and adding this value to the JVM that starts JBoss didn't seem to work either however.

      Could somebody give us a hint ? Anything would really help and would be very much appreciated.

      Our environment:
      JBoss 3.2.1
      JDK 1.4.1

      Thanks
      spicq