Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import of compiler messages: first line of files with BOM is ignored #1859

Closed
guwirth opened this issue May 7, 2020 · 3 comments · Fixed by #2020
Closed

Import of compiler messages: first line of files with BOM is ignored #1859

guwirth opened this issue May 7, 2020 · 3 comments · Fixed by #2020

Comments

@guwirth
Copy link
Collaborator

guwirth commented May 7, 2020

In case the LOG file is a file with BOM the first line can't be read. This is a problem if the first line contains a warning (which is typically not the case).

Todo: Handle LOG files with BOM, possible solutions:

  • ignore BOM
  • interpret BOM and use it instead of charset

https://github.com/google/gdata-java-client/blob/master/java/src/com/google/gdata/util/io/base/UnicodeReader.java

@ysiw
Copy link

ysiw commented Jun 5, 2020

C/C++ source files with BOM also report C++ Parser can't read code. Declaration is skipped. for line 1.

image

@guwirth
Copy link
Collaborator Author

guwirth commented Jun 5, 2020

Hello @ysiw,

that seems to be a different issue. The one here is about parsing reports, your one about parsing source code files.

Seems you have to set the correct sonar.sourceEncoding?
https://docs.sonarqube.org/latest/analysis/analysis-parameters/

Regards,

guwirth added a commit to guwirth/sonar-cxx that referenced this issue Jan 1, 2021
- if file has a BOM use BOM charset
- if no BOM, use xxx.charset value
- otherwise use default UTF8
- close SonarOpenCommunity#1859
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

2 participants