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

GBK encoding caused CodeQL to detect code written in Java/Kotlin, but it was unable to process any of it #18527

Open
Weijin-wj opened this issue Jan 17, 2025 · 1 comment
Labels
question Further information is requested

Comments

@Weijin-wj
Copy link

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.

@Weijin-wj Weijin-wj added the question Further information is requested label Jan 17, 2025
@redsun82
Copy link
Contributor

👋 @Weijin-wj I'm glad you found a workaround! Let me circle back to the internal team to see if UTF8 encoding is a known requirement or if this is a bug we need to solve. Even if it were the former case, we would definitely need to improve how this is reported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants