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

Non ASCII chars get mangled when a new user is created

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • core
    • None
    • Platform: All, OS: Windows XP

      Non ASCII chars get mangled when a new user is created.
      Sample name: äöüß becomes äöüß (ok, this is extreme for usernames, but at
      least full names must be enabled to have non ASCII characters).

      It is one of the common problems when running an application server on Windows:
      the default charset of the server is cp1252, the charset of the web application
      is UTF-8. When you don't take care of this, you'll get in trouble.

      There is a puzzling effect: After you edit the name as an administrator, the non
      ASCII chars are correctly displayed!

      Another effect is, that the user list becomes longer and longer whith entries like:
      äöüß
      äöüß
      äöüß

          [JENKINS-2026] Non ASCII chars get mangled when a new user is created

          I couldn't reproduce this.

          This is probably because you run Hudson on a servlet container that doesn't
          handle encoding correctly. Starting 1.228, Hudson checks this and produeces a
          warning (see the changelog for 1.228 for details), so if you are using an older
          version, please check this.

          Tomcat is perhaps the prime example of this. See
          http://hudson.gotdns.com/wiki/display/JENKINS/Tomcat for more details about
          Tomcat and encoding.

          If your case doesn't apply to any of the above, please let us know your
          container and Hudson version.

          Kohsuke Kawaguchi added a comment - I couldn't reproduce this. This is probably because you run Hudson on a servlet container that doesn't handle encoding correctly. Starting 1.228, Hudson checks this and produeces a warning (see the changelog for 1.228 for details), so if you are using an older version, please check this. Tomcat is perhaps the prime example of this. See http://hudson.gotdns.com/wiki/display/JENKINS/Tomcat for more details about Tomcat and encoding. If your case doesn't apply to any of the above, please let us know your container and Hudson version.

          jiai added a comment -

          My case doesn't apply: Tomcat showed the warning which you described, I inserted
          the attribute URIEncoding="UTF-8". But there is no change, the warning vanished
          but non-ASCII-characters are mangled further on.

          My configuration is:

          • Hudson 1.236
          • Tomcat 6.0.14 (Using port 9090 directly, 8080 is used by another application)
          • JRE/JDK (most likely) 1.6.0_02
          • Windows Server 2003, Charset cp1252 operating system in english, language
            version non unicode programs will use: english

          jiai added a comment - My case doesn't apply: Tomcat showed the warning which you described, I inserted the attribute URIEncoding="UTF-8". But there is no change, the warning vanished but non-ASCII-characters are mangled further on. My configuration is: Hudson 1.236 Tomcat 6.0.14 (Using port 9090 directly, 8080 is used by another application) JRE/JDK (most likely) 1.6.0_02 Windows Server 2003, Charset cp1252 operating system in english, language version non unicode programs will use: english

          sogabe added a comment -

          Reproducable on Glassfish.

          the following patch maybe fix this.

          Index: HudsonPrivateSecurityRealm.java
          ===================================================================
          — HudsonPrivateSecurityRealm.java (revision 10950)
          +++ HudsonPrivateSecurityRealm.java (working copy)
          @@ -79,6 +79,7 @@

          • Creates an user account. Used for self-registration.
            */
            public void doCreateAccount(StaplerRequest req, StaplerResponse rsp) throws
            IOException, ServletException {
            + req.setCharacterEncoding("UTF-8");
            if(!allowsSignup()) {
            rsp.sendError(SC_UNAUTHORIZED,"User sign up is prohibited");
            return;

          sogabe added a comment - Reproducable on Glassfish. the following patch maybe fix this. Index: HudsonPrivateSecurityRealm.java =================================================================== — HudsonPrivateSecurityRealm.java (revision 10950) +++ HudsonPrivateSecurityRealm.java (working copy) @@ -79,6 +79,7 @@ Creates an user account. Used for self-registration. */ public void doCreateAccount(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException { + req.setCharacterEncoding("UTF-8"); if(!allowsSignup()) { rsp.sendError(SC_UNAUTHORIZED,"User sign up is prohibited"); return;

          Code changed in hudson
          User: : kohsuke
          Path:
          trunk/hudson/main/core/src/main/java/hudson/security/HudsonPrivateSecurityRealm.java
          trunk/www/changelog.html
          http://fisheye4.cenqua.com/changelog/hudson/?cs=24880
          Log:
          [FIXED JENKINS-2026] in 1.340 by applying the patch.

          SCM/JIRA link daemon added a comment - Code changed in hudson User: : kohsuke Path: trunk/hudson/main/core/src/main/java/hudson/security/HudsonPrivateSecurityRealm.java trunk/www/changelog.html http://fisheye4.cenqua.com/changelog/hudson/?cs=24880 Log: [FIXED JENKINS-2026] in 1.340 by applying the patch.

            Unassigned Unassigned
            jiai jiai
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: