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

XML Parsers should use report encoding given in XML file

    XMLWordPrintable

    Details

    • Similar Issues:
    • Released As:
      5.0.0 (analysis-model and warnings-ng)

      Description

      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>
      

        Attachments

          Activity

          Hide
          sschlet 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.

          Show
          sschlet 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.
          Hide
          drulli Ulli Hafner added a comment - - edited

          Stefan Schletterer 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?

          Show
          drulli Ulli Hafner added a comment - - edited Stefan Schletterer 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?
          Hide
          drulli 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.

          Show
          drulli 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.
          Hide
          sschlet Stefan Schletterer added a comment -

          Ulli Hafner 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.

          Show
          sschlet Stefan Schletterer added a comment - Ulli Hafner 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.

            People

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

              Dates

              Created:
              Updated:
              Resolved: