sonar.sourceEncoding=UTF-8
如果sonarscan设置的编码是utf-8那么,如果代码中有gd2312编码的话,很可能cppcheck扫描出来的问题,并不能上传到sonarqube上展示。
比如cppcheck扫描出来200个问题,soanrqube上展示100个。
此时需要解决编码问题。
@echo off
powershell.exe -command “dir *.txt -R|foreach-object{[void][System.IO.File]::WriteAllBytes( . F u l l N a m e , [ S y s t e m . T e x t . E n c o d i n g ] : : C o n v e r t ( [ S y s t e m . T e x t . E n c o d i n g ] : : G e t E n c o d i n g ( ′ G B K