I am using SonarLint in the following environment
Visual Studio 2022 (Version 17.8.5)
SonarLint for Visual Studio 2022 (Version 7.6.0.83111)
When scanning a .cpp file with a character encoding of Shift_JIS, the following error message was output.
[CFamily] Note: the following CFamily rules are not available in SonarLint: cpp:S5536, c:S5536, cpp:S4830, c:S4830, cpp:S5527, c:S5527
[CLangAnalyzer] Analyzing C:\wk\devsecos\sonareval\monosSekkei\Monos.Client.D.Design\Source File\Madoban\Information\CShiyoMdbnDtlSetup.cpp
[CLangAnalyzer] Failed to analyze C:\wk\devsecos\sonareval\monosSekkei\Monos.Client.D.Design\Source File\Madoban\Information\CShiyoMdbnDtlSetup.cpp: System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parametername:end
at Microsoft.VisualStudio.Text.SnapshotSpan..ctor(SnapshotPoint start, SnapshotPoint end)
at SonarLint.VisualStudio.IssueVisualization.Editor.IssueSpanCalculator.CalculateSpan(ITextRange range, ITextSnapshot currentSnapshot)
at SonarLint.VisualStudio.IssueVisualization.Models.AnalysisIssueVisualizationConverter.Convert(IAnalysisIssueBase issue, ITextSnapshot textSnapshot)
at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
at SonarLint.VisualStudio.Integration.Vsix.AccumulatingIssueConsumer.Accept(String path, IEnumerable`1 issues)
at SonarLint.VisualStudio.CFamily.SubProcess.MessageHandler.HandleMessage(Message message)
at SonarLint.VisualStudio.CFamily.SubProcess.Protocol.Read(BinaryReader reader, Action`1 handleIssue)
at SonarLint.VisualStudio.CFamily.Analysis.CLangAnalyzer.<>c__DisplayClass17_0.<ExecuteSubProcess>b__1(StreamReader reader)
at SonarLint.VisualStudio.CFamily.SubProcess.ProcessRunner.Execute(ProcessRunnerArguments runnerArgs)
at SonarLint.VisualStudio.CFamily.Analysis.CLangAnalyzer.ExecuteSubProcess(Action`1 handleMessage, IRequest request, IProcessRunner runner, ILogger logger, CancellationToken cancellationToken, IFileSystem fileSystem)
at SonarLint.VisualStudio.CFamily.Analysis.CLangAnalyzer.CallSubProcess(Action`1 handleMessage, IRequest request, ISonarLintSettings settings, ILogger logger, CancellationToken cancellationToken)
at SonarLint.VisualStudio.CFamily.Analysis.CLangAnalyzer.RunAnalysis(IRequest request, IIssueConsumer consumer, IAnalysisStatusNotifier statusNotifier, CancellationToken cancellationToken)
Refreshing PCH file for C:\wk\devsecos\sonareval\monosSekkei\Monos.Client.D.Design\Source File\Madoban\Information\CShiyoMdbnDtlSetup.cpp. PCH file location: C:\Users\user001\AppData\Local\Temp\SLVS\PCH\7cbf8838-645a-49dd-9d44-060b8b432358\PCH.preamble
ERROR: LLVM ERROR: IO failure on output stream: broken pipe
- Only some Shift_JIS encoded .cpp will have errors. (Most Shift_JIS encoded .cpps do not cause errors.)
- If the file in error is converted to UTF-8 and saved, no error will occur.
How can I work around this problem without doing a file encoding conversion (Shift_JIS to UTF-8)?