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

XML Parsers should use report encoding given in XML file

    • 5.0.0 (analysis-model and warnings-ng)

      Currently, the encoding needs to defined for the parser as parameter, it would be handy if the parser could detect the encoding.

      <?xml version="1.0" encoding="UTF-8"?>
      <checkstyle version="4.1">
      ...
      </checkstyle>
      

          [JENKINS-52477] XML Parsers should use report encoding given in XML file

          Stefan Schletterer added a comment - - edited

          I second that, especially for larger C/C++ projects it is difficult to specify an encoding since most newer .cpp / .h files are UTF-8 but older .c Files in the same project are ANSI encoded (We use cppCheck and ClangTidy). The current workaround is to convert all files to UTF-8 just before the analysis.

          Stefan Schletterer added a comment - - edited I second that, especially for larger C/C++ projects it is difficult to specify an encoding since most newer .cpp / .h files are UTF-8 but older .c Files in the same project are ANSI encoded (We use cppCheck and ClangTidy). The current workaround is to convert all files to UTF-8 just before the analysis.

          Ulli Hafner added a comment - - edited

          sschlet This issue is about XML report files, they have the encoding of the file already given in the xml tag.

          Your comment is about the source code encoding, isn't it?

          Ulli Hafner added a comment - - edited sschlet This issue is about XML report files, they have the encoding of the file already given in the xml tag. Your comment is about the source code encoding, isn't it?

          Ulli Hafner added a comment -

          If your problem is similar to last comment in JENKINS-55350, then we should create a new issue about to handle projects that use different source code encodings.

          Ulli Hafner added a comment - If your problem is similar to last comment in JENKINS-55350 , then we should create a new issue about to handle projects that use different source code encodings.

          drulli Oh sorry thats right, my issue was regarding the source file encoding. Also I only realized now that C++ files are typically  ISO8859-1 encoded and with this settings the source files are parsed just fine.

          Stefan Schletterer added a comment - drulli Oh sorry thats right, my issue was regarding the source file encoding. Also I only realized now that C++ files are typically   ISO8859-1  encoded and with this settings the source files are parsed just fine.

            mschmidae Michael Schmid
            drulli Ulli Hafner
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: