5 Replies Latest reply on Jul 15, 2003 1:01 PM by Jon Barnett

    JBOSS3.2.1/JETTY international characters support

    Dmitry Newbie

      I'm trying to build a web site that supports russian characters in koi8-r.

      For some reason the browser (I tried IE as well as Nescape 7) does not recognise automatically what language the page is in so it shows gardbage. In order to show the correct language I have to go to the browsers menu, chose view/character coding/cyrillic koi8-r. It shows the page correctly but does not keep the setting, the next time i click some link, the browser goes back to it's default wich it ISO-8859-1.

      According to some recomendations i found on the web i tried to put following lines in my jsps:

      <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

      <meta HTTP-EQUIV="Content-type" CONTENT="text/html; charset=koi8-r"/>

      Has no effect (the browser still does not recognise the language).


      Then i tried to put jsp directive on the jsp page:

      <% page contentType='text/html; charset=KOI8-R' %>
      Now the browser switches to the right language automatically and keeps it, but renders all the russian characters as ???????????????. It looks like the translation has gone twise somewere.

      I was also trying to play with mimetypes in web.xml -- does not seem to have any effect.
      I also tried to change default mimetype handling in jetty configuration -- no effect as well.

      HELP!!!

        • 1. Re: JBOSS3.2.1/JETTY international characters support
          Dmitry Newbie

          Has any one ever tried international characters support with jboss3.2.1/jetty?
          Please let me know.
          If this is an existing known problem i will have to look for some other solution that can reliably work with international character sets.

          • 2. Re: JBOSS3.2.1/JETTY international characters support
            olegi Newbie

            Existing, but unknown for developers :)
            i tryed - JBoss works only with 8859-1 charset. It does not matter what Locale in OS is used.

            • 3. Re: JBOSS3.2.1/JETTY international characters support
              Bruce Wilson Newbie


              Hi Dmitry !

              The app I'm working on has to support entry and
              display of asian characters (Japanese and Chinese).
              I'm currently deploying this on JBoss 3.0.7, but
              perhaps this will also help for 3.2.1 (the following
              applies to the Jetty web server which comes with
              JBoss, don't know what you're using so YMMV).

              Adding the following to the head of my JSPs was
              sufficient to display asian text correctly:

              <%@ page contentType="text/html; charset=UTF-8" %>

              (this is similar to what you did in your situation)

              But in order to enter Asian text correctly at the
              browser and have it received correctly by my
              application at the server side, I had to "hack"
              a Jetty-related property on the java command line:

              -DISO_8859_1=UTF-8

              This changes the character set which Jetty uses to
              process named parameters coming in with HTTP
              requests. Without this, the text is saved (then later
              displayed) as junk. Perhaps setting this property
              to "koi8-r" will help you. Or perhaps just using UTF-8
              will do as well ?

              According to a post I found from Greg Wilkins, the
              above property is supposed to be used to change
              the "alias" by which the ISO-8859 encoding is specified
              (apparently, it can be "ISO_8859_1", "ISO-8859-1", etc
              depending on the JVM used), but posts from others
              say that they have have found it useful for supporting
              non-8859-1 text as well.

              In my case, I also had to set the national character
              set of my Oracle database to UTF-8 in order for things
              to work correctly.

              Hope this helps.

              - Bruce

              • 4. Re: JBOSS3.2.1/JETTY international characters support
                Dmitry Newbie

                So,
                it does not work, i tried all possible combinations and seems that Oleg is right -- the jetty only works with 8859-1.
                Does anyone on the jboss/jetty team know if this is going to change any time soon?

                Also, how about tomcat? Has anyone tried tomcat with international characters and can reliably say that it does work.

                Dmitry A>

                • 5. Re: JBOSS3.2.1/JETTY international characters support
                  Jon Barnett Master

                  You probably need to go to the respective Jetty and Tomcat forums for your answers. The JBoss guys just provide the glue to bind the servlet container to the JBoss framework. The actual HTML and browser interaction is handled by the servlet container code which is not under the control of the JBoss Group. However, you might check in general JSP/servlet forums.

                  Java Guru has this to say on the matter:
                  http://www.jguru.com/faq/view.jsp?EID=224631

                  Mortbay, the providers of Jetty code present this:
                  http://www.mortbay.org/jetty/doc/international.html