Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-302

Encoding support and UTF-8

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: core
    • Labels:
      None
    • Environment:
      Platform: All, OS: All
    • Similar Issues:

      Description

      Hudson seems to be working only on ISO-8859-1 mode.
      My client is running UTF-8 as is my server. This is the default encoding of my
      firefox also.
      But when I tried to submit the configuration form with a 'é' char it was not
      reproduced correctly

        Attachments

          Activity

          Hide
          ehsavoie ehsavoie added a comment -

          Well I have the problem in the configuration page for Hudson when I tried to set
          the Welcome Message
          I have the same issue with the job configuration form (in the description field
          for example).
          If you have trace to activate so that I can check where all goes wrong.
          As for the header I didn't see any META tag (like <META
          HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">) in the HTML
          header (not the HTTP response header which is correctly set).
          I'll get the source bundle for 1.81 and maybe add a trace or two ;o). What is
          most surprising is that I am full UTF-8, from my client OS to my server or my scm

          Show
          ehsavoie ehsavoie added a comment - Well I have the problem in the configuration page for Hudson when I tried to set the Welcome Message I have the same issue with the job configuration form (in the description field for example). If you have trace to activate so that I can check where all goes wrong. As for the header I didn't see any META tag (like <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">) in the HTML header (not the HTTP response header which is correctly set). I'll get the source bundle for 1.81 and maybe add a trace or two ;o). What is most surprising is that I am full UTF-8, from my client OS to my server or my scm
          Hide
          kohsuke Kohsuke Kawaguchi added a comment -

          You still haven't given me the exact steps to reproduce, but I guess that's

          1. go to http://localhost/hudson/job/myjob/configure
          2. type 'é' in the job description
          3. press submit
          4. see http://localhost/hudson/job/myjob/ and confirm that
          the displayed description is wrong

          But I've already done this, and it works for me. And my experience suggests this
          is usually a container configuration issue, if you are using a reasonably modern
          browser. Tomcat for example is known to be broken in this area, as described in
          the document.

          There shouldn't be any <META> tag, since Hudson instructs the web container to
          send proper HTTP header. If you are using Firefox, you can confirm that by
          looking at "view page info" from the context menu.

          The line you want to look at is core/src/main/java/hudson/model/Job.java line
          451 where it does:

          > description = req.getParameter("description");

          I suspect the req.getParameter("description") method is returning a wrong value,
          and if so, it is because the container uses a wrong encoding to interpret the
          request. If you can check this, that would be great.

          I also recommend double-check Tomcat's connector setting.

          Show
          kohsuke Kohsuke Kawaguchi added a comment - You still haven't given me the exact steps to reproduce, but I guess that's 1. go to http://localhost/hudson/job/myjob/configure 2. type 'é' in the job description 3. press submit 4. see http://localhost/hudson/job/myjob/ and confirm that the displayed description is wrong But I've already done this, and it works for me. And my experience suggests this is usually a container configuration issue, if you are using a reasonably modern browser. Tomcat for example is known to be broken in this area, as described in the document. There shouldn't be any <META> tag, since Hudson instructs the web container to send proper HTTP header. If you are using Firefox, you can confirm that by looking at "view page info" from the context menu. The line you want to look at is core/src/main/java/hudson/model/Job.java line 451 where it does: > description = req.getParameter("description"); I suspect the req.getParameter("description") method is returning a wrong value, and if so, it is because the container uses a wrong encoding to interpret the request. If you can check this, that would be great. I also recommend double-check Tomcat's connector setting.
          Hide
          ehsavoie ehsavoie added a comment -

          I do agree that the right http headers are sent and I am positive that
          Firefox use UTF-8 as the display encoding.
          For the steps you are right and it happens on the Hudson System Configuration
          Page when for example I set a welcome message.
          For the Tomcat conf I added the URIEncoding into the connector element but this
          changed nothing.
          I should have some time to further my investigations today so I hope to have a
          clear answer.

          Show
          ehsavoie ehsavoie added a comment - I do agree that the right http headers are sent and I am positive that Firefox use UTF-8 as the display encoding. For the steps you are right and it happens on the Hudson System Configuration Page when for example I set a welcome message. For the Tomcat conf I added the URIEncoding into the connector element but this changed nothing. I should have some time to further my investigations today so I hope to have a clear answer.
          Hide
          ehsavoie ehsavoie added a comment -

          Ok, my mistake this was a Tomcat problem but a subtler one than you might think.
          Someone had put the RequestDumperValve on the server and this is what is
          breaking the UTF-8. Changing the URIEncoding has no effect on this
          Sorry for the disturbance.
          All is working fine now :o)

          Show
          ehsavoie ehsavoie added a comment - Ok, my mistake this was a Tomcat problem but a subtler one than you might think. Someone had put the RequestDumperValve on the server and this is what is breaking the UTF-8. Changing the URIEncoding has no effect on this Sorry for the disturbance. All is working fine now :o)
          Hide
          kohsuke Kohsuke Kawaguchi added a comment -

          Added note to http://hudson.dev.java.net/i18n.html. Marking as fixed.

          Show
          kohsuke Kohsuke Kawaguchi added a comment - Added note to http://hudson.dev.java.net/i18n.html . Marking as fixed.

            People

            • Assignee:
              Unassigned
              Reporter:
              ehsavoie ehsavoie
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: