Uploaded image for project: 'SonarQube'
  1. SonarQube
  2. SONAR-9388

Windows-1252 encoding is not detected

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 6.4
    • Fix Version/s: 6.5-M1, 6.5
    • Component/s: Scanner
    • Labels:
      None

      Description

      Currently the scanner doesn't detect when a file has Windows-1252 charset, and tries to fall back to UTF-8 instead. When a source file contains a character that's invalid UTF-8 but valid Windows-1252, such as 0xBD = 189, the scanner will print a warning and skip analyzing the file:

      WARNING: WARN: Encoding detected by Roslyn and encoding used by SonarQube do not match for file C:\...\CodeGen\...\SomeFile.cs. SonarQube encoding is 'UTF-8', Roslyn encoding is 'windows-1252'. File will be skipped.
      

      Originally reported here:
      https://groups.google.com/forum/#!msg/sonarqube/NEDyIj7heDc/xrYF6x8KBgAJ

        Attachments

          Activity

            People

            • Assignee:
              janos.gyerik Janos Gyerik
              Reporter:
              janos.gyerik Janos Gyerik
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Due:
                Created:
                Updated:
                Resolved: