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

change description containing national characters not showing in changelog

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: cvs-plugin
    • Labels:
      None
    • Environment:
      Windows Server 2008 r2, Jenkins running as windows service
    • Similar Issues:

      Description

      I have a "free-style software project" job, that checkouts project from CVS. If I add a description to cvs commit that contains national characters (Polish in my case, e.g. ą, ę, ł, ó), Jenkins doesn't show these changes in changelog (in fact Jenkins show no changes for entire build containing such a commit, even though there are other commits not containing national characters).
      But changelog.xml files seems to be generated properly.

      I think this behaviour started after upgrading cvs plugin from 1.6 to 2.4 (but i am not 100% sure).

      I also noticed a problem with jabber notifications, that may by connected to this issue. If a build contains such an "invalid" commit, then cvs commiters are not notified on broken build. I'm not sure, if these two issues are realy connected, but thought it might be helpfull.

        Attachments

          Activity

          kosmaty Krzysztof Kosmatka created issue -
          Hide
          kosmaty Krzysztof Kosmatka added a comment -

          It seems to be invalid encoding of changelog.xml file. It declares "UTF-8" encoding, but it seems to be encoded in "cp1250".

          Show
          kosmaty Krzysztof Kosmatka added a comment - It seems to be invalid encoding of changelog.xml file. It declares "UTF-8" encoding, but it seems to be encoded in "cp1250".
          Hide
          kosmaty Krzysztof Kosmatka added a comment -

          I attach changelog.xml with a comment "ąęśćńłó".

          Show
          kosmaty Krzysztof Kosmatka added a comment - I attach changelog.xml with a comment "ąęśćńłó".
          kosmaty Krzysztof Kosmatka made changes -
          Field Original Value New Value
          Attachment changelog.xml [ 22312 ]
          Hide
          gisode Giso Deutschmann added a comment -

          I ran into the same problem. The cause can be found in hudson.scm.CVSChangeLogSet.toFile(). The line

          PrintStream output = new PrintStream(new FileOutputStream(changelogFile));
          

          opens a PrintStream with the system-default encoding. Later, however, the following is done:

          output.println("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
          

          That is, the XML always asserts that it is encoded in UTF-8, while the actual encoding of the file is system-dependent.

          Fix:

          PrintWriter output;
          try {
              output = new PrintWriter(new OutputStreamWriter(new FileOutputStream(changelogFile), "utf-8"));
          } catch(UnsupportedEncodingException e) {
              throw new RuntimeException(e); // or whatever
          }
          
          Show
          gisode Giso Deutschmann added a comment - I ran into the same problem. The cause can be found in hudson.scm.CVSChangeLogSet.toFile(). The line PrintStream output = new PrintStream( new FileOutputStream(changelogFile)); opens a PrintStream with the system-default encoding. Later, however, the following is done: output.println( "<?xml version=\" 1.0\ " encoding=\" UTF-8\ "?>" ); That is, the XML always asserts that it is encoded in UTF-8, while the actual encoding of the file is system-dependent. Fix: PrintWriter output; try { output = new PrintWriter( new OutputStreamWriter( new FileOutputStream(changelogFile), "utf-8" )); } catch (UnsupportedEncodingException e) { throw new RuntimeException(e); // or whatever }
          mc1arke Michael Clarke made changes -
          Status Open [ 1 ] In Progress [ 3 ]
          mc1arke Michael Clarke made changes -
          Assignee Michael Clarke [ mc1arke ]
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: mc1arke
          Path:
          src/main/java/hudson/scm/AbstractCvs.java
          src/main/java/hudson/scm/CVSChangeLogSet.java
          src/main/java/hudson/scm/CVSSCM.java
          src/main/java/hudson/scm/CvsProjectset.java
          src/main/java/hudson/scm/ICvsDescriptor.java
          http://jenkins-ci.org/commit/cvs-plugin/2f8e49edf358d4f01b385a5fad69e1182fa71006
          Log:
          Specifying encoding to read/write temporary files and changelogs in
          [FIXED JENKINS-4633] Force changelog encoding during file read
          [FIXED JENKINS-14678] Force changelog encoding during file write

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: mc1arke Path: src/main/java/hudson/scm/AbstractCvs.java src/main/java/hudson/scm/CVSChangeLogSet.java src/main/java/hudson/scm/CVSSCM.java src/main/java/hudson/scm/CvsProjectset.java src/main/java/hudson/scm/ICvsDescriptor.java http://jenkins-ci.org/commit/cvs-plugin/2f8e49edf358d4f01b385a5fad69e1182fa71006 Log: Specifying encoding to read/write temporary files and changelogs in [FIXED JENKINS-4633] Force changelog encoding during file read [FIXED JENKINS-14678] Force changelog encoding during file write
          mc1arke Michael Clarke made changes -
          Status In Progress [ 3 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          rtyler R. Tyler Croy made changes -
          Workflow JNJira [ 145374 ] JNJira + In-Review [ 191459 ]

            People

            • Assignee:
              mc1arke Michael Clarke
              Reporter:
              kosmaty Krzysztof Kosmatka
            • Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: