GBK encoding caused CodeQL to detect code written in Java/Kotlin, but it was unable to process any of it #18527
Open
Description
Hello, I encountered the following issue while creating a database using codeql:
CodeQL detected code written in Java/Kotlin but could not process any of it. For more information, review our troubleshooting guide at https://gh.io/troubleshooting-code-scanning/no-source-code-seen-during-build.
Later I found out it was because the Maven project used GBK encoding, and the pom file is configured as follows:
<project.build.sourceEncoding>GBK</project.build.sourceEncoding>
<project.reporting.outputEncoding>GBK</project.reporting.outputEncoding>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
<encoding>GBK</encoding>
</configuration>
</plugin>
I then changed GBK to UTF-8 in the pom file, successfully created the database, and there was no prompt as above. Could you please explain why GBK encoding causes this issue? I feel that my solution is not elegant enough. Are there any other better methods? Thank you.