gpt4 book ai didi

c# - Sonar "Invalid character encountered in file"未分析的一些文件

转载 作者:太空狗 更新时间:2023-10-29 23:50:12 24 4
gpt4 key购买 nike

我有几个文件未通过以下消息进行分析:

Invalid character encountered in file [file name with full path] at line 9 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.

在 Visual Studio 中,当我选择文件/高级保存选项时,文件被设置为西欧 (Windows) - 代码页 1252。

我将其更改为 Unicode(带签名的 UTF-8)- 代码页 65001。

但是 SonarQube 仍然提示无效字符。 “无效字符”是带有变音字符 (ä,ö,ü) 的德语注释

我该怎么做才能解决这个问题(不删除评论)?

最佳答案

用于 MSBuild 的 SonarQube 扫描器和 SonarQube C# 插件目前期望项目的所有文件都具有 UTF-8 编码 - 这是硬编码的。

有一张票可以在未来的版本中对此进行改进:https://jira.sonarsource.com/browse/SONARMSBRU-174

关于c# - Sonar "Invalid character encountered in file"未分析的一些文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33671884/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com