5 Replies Latest reply on May 12, 2004 6:28 PM by ziyu

    any plan to make nukes works on multi language ?:

    ziyu Newbie

      It' seem nukes only friendly with single byte language.
      I want to make it works width tranditional chinese, but it's seem not easy to find a entrance.

      Did any nukes team memeber consider to define a good architechture wthich can make the whole nukes modules work friendly with any language.

      There is at least three places to consider:
      1. doPost , doGet method in servlet , must reconize the encoding of the client (browser) input. This should be responsibility of servlet spec, but earlier servlet implementation did not handle very well, I don't know what verstion of servlet/tomcat can handle it correctly or it is still a stupid bug ?

      2. html page encode problems: bb module encode/decode content seems has problem, it will encode all double byte charactor into a form like "&#23243". Can anybody explain why?

      3. database connection: make sure it store correct data. I am not family with mysql, but I know mysql can work with utf8 encoding. I have a little expriernce with MS-SQL JDBC driver long long ago. You have to gvive explict encoding parameter in connection.

      I think all output rendering html page should be UTF-8 encoding, this coding is accept in most browser and works very good in multi language display.

      Java is i18n build-in, if we define it well, everything will goes well. What we have to do is just format the message like timestampe in bb module.

      Sorry for my poor english grammar.

        • 1. Re: any plan to make nukes works on multi language ?:
          Viet Master

          Check what I have modified yesterday in CVS for the HTML module : now it is possible to put more chars. I don't think it works for chinese but at least it works for the more common used on internet. That entity encoding produce output which is independant from the output charset on the HttpServletResponse.

          Basically, it's ok with MySQL for storing String object without information loss. So when a user submit some form with chars, these are properly stored in the database. I think this is because the parameters are taken from the HttpRequest which decodes them as String acccording to the content type.

          So what cause problem is rather the other part, sending data to the client. What the HTML does now is it takes the String from the database and converts to HTML entity any chars that belongs to that table : http://cvs.sourceforge.net/viewcvs.py/*checkout*/jboss/nukes/common/src/main/org/jboss/nukes/common/util/EntityTable.java?content-type=text%2Fplain&rev=1.1

          I guess that the chinese chars are not listed here, so the question is, is there a way to display these chars independantly from the charset ? I don't know yet and I have to look at that.

          • 2. Re: any plan to make nukes works on multi language ?:
            ziyu Newbie

            chinese is not in this table of cause, but it seems nukes still conver it entity. Could you tell me where the code is ?

            What I see and the problems is :
            when input has chinese charactor , it conver it to HTML entity ( it's weird ) and the content will become 哈

            next, when rendering the output html, it will encode '&' into '&' , so the output will become '哈' then the html entitity will show in display not the chinese char we want .

            I can't understand why nukes comvert the input to HTML entity, it should not. It should only convert the chars to HTML entity when rendering the HTML page.

            If we use HTML entity to show none ASCII char , of cause, we can display chars indenpdent the encoding. BUT, this will be a problem for web designer to debug the rendered html page when they see the HTML source.

            Since most brower suport UTF-8 encoding , I strong recommand nukes use UTF-8 as default.

            Could you tell me where to set the html page encoding
            I have try to modify this in
            nukes.ear/nukes.sar/META-INF/jboss-service.xml
            but it seems not work.

            Thank you for your help

            • 3. Re: any plan to make nukes works on multi language ?:
              ziyu Newbie

              sorry , correct these line

              What I see and the problems is :
              when input has chinese charactor , it conver it to HTML entity ( it's weird ) and the content will become ''哈

              next, when rendering the output html, it will encode '&' into '&' , so the output will become '哈' , HTML entitity code will show in display not the chinese char we want .

              • 4. Re: any plan to make nukes works on multi language ?:
                Viet Master

                I will look at it. Could you point me to a forum entry where you have chinese chars so I can copy/paste into my local nukes to test ?

                • 5. Re: any plan to make nukes works on multi language ?:
                  ziyu Newbie

                   

                  "cooper" wrote:
                  I will look at it. Could you point me to a forum entry where you have chinese chars so I can copy/paste into my local nukes to test ?


                  Here I type two chinese chars which means "chinese"

                  中文

                  If you quote this message, tt will dispaly correct chinese chars in text area.