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

Character encoding not defined explicitly when serving HTML help files

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Critical Critical
    • core
    • None
    • Platform: All, OS: All

      It seems that the character encoding used when serving HTML help files depends
      on the web container (and system environment?) serving them.

      At the moment, this causes non-english help texts to be displayed mangled in the
      GUI.

      These were the values for the HTTP header "Content-Type" in my setups:

      Jetty/Windows: "text/html", i.e. no encoding specified at all.
      Winstone/Windows: "text/html;charset=utf-8"
      Winstone/Linux: "text/html;charset=ISO-8859-1"

      As all HTML files within the Hudson web application are encoded in UTF-8, I
      would suggest to enforce that convention by nailing down the encoding with a
      filter in web.xml like the following?

      [...snip...]

      <filter>
      <filter-name>force-encoding-filter</filter-name>
      <filter-class>hudson.ResponseHeaderFilter</filter-class>
      <init-param>
      <param-name>Content-Type</param-name>
      <param-value>text/html;charset=utf-8</param-value>
      </init-param>
      </filter>

      <filter-mapping>
      <filter-name>force-encoding-filter</filter-name>
      <url-pattern>*.html</url-pattern>
      </filter-mapping>

      [...snap...]

      Given an OK, I could change the web.xml accordingly.

            Unassigned Unassigned
            swiest Simon Wiest
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: