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

Characters don't work on Windows #29

Open
garfieldnate opened this issue Apr 13, 2021 · 6 comments · May be fixed by #30
Open

Characters don't work on Windows #29

garfieldnate opened this issue Apr 13, 2021 · 6 comments · May be fixed by #30

Comments

@garfieldnate
Copy link

It appears that the unicode characters are not generated or recognized correctly on Windows.

I've opened a PR to add a GitHub action to build on Windows, Linux and Mac; the Windows build always fails, though, because the tables look like this:

    ?          compressed           ?          uncompressed          
        ?????????????????????????????????????????????????????????????????
APK      ? old       ? new       ? diff  ? old       ? new       ? diff   
???????????????????????????????????????????????????????????????????????????
    dex ? 664.8 KiB ? 664.8 KiB ? -25 B ?   1.5 MiB ?   1.5 MiB ? -112 B 
    arsc ? 201.7 KiB ? 201.7 KiB ?   0 B ? 201.6 KiB ? 201.6 KiB ?    0 B 
manifest ?   1.4 KiB ?   1.4 KiB ?   0 B ?   4.2 KiB ?   4.2 KiB ?    0 B 
    res ? 418.2 KiB ? 418.2 KiB ? -14 B ? 488.3 KiB ? 488.3 KiB ?    0 B 
    asset ?       0 B ?       0 B ?   0 B ?       0 B ?       0 B ?    0 B 
    other ?  37.1 KiB ?  37.1 KiB ?   0 B ?  36.3 KiB ?  36.3 KiB ?    0 B 
???????????????????????????????????????????????????????????????????????????

See build results here.

garfieldnate added a commit to garfieldnate/picnic that referenced this issue Apr 14, 2021
I'm honestly not sure why this is required, since Kotlin files are
supposed to always be UTF-8. Without this, though, the build fails on
Windows due to all special table characters being turned into ???.

Fixes JakeWharton#29.
@garfieldnate garfieldnate linked a pull request Apr 14, 2021 that will close this issue
@garfieldnate
Copy link
Author

All fixed in my PR ;) If you could let me know if you are able to merge and release it soonish that would be super helpful; otherwise I'll need to fork it to release the project I've been working on (or, of course, use a different table renderer... but I like this one:) ).

@garfieldnate
Copy link
Author

I just realized that the issue is actually with the compilation of the test files; my test files also use the special non-ASCII characters, and setting the encoding correctly makes the tests pass on Windows. So I'm not blocked in any way by this ticket. I hope that it can still be a useful contribution for you. Thanks again for the amazing project! :)

@jakepurple13
Copy link

Any updates to this? I've recently ran into this too.

@garfieldnate
Copy link
Author

@jakepurple13 If you're running into this while testing your own project, I would just set compileTestJava.options.encoding = "UTF-8". This will prevent the issue from affecting your tests, and you won't be dependent on picnic being updated/released.

@jakepurple13
Copy link

jakepurple13 commented Dec 9, 2022

I'm trying to make a gradle plugin using this. And I'm also using gradle kts and couldn't find a way to set the compileTestJava one.

Edit:
I think I found a way to change it

tasks.withType<JavaCompile>().let {
    it["compileJava"].options.encoding = "UTF-8"
    it["compileTestJava"].options.encoding = "UTF-8"
}

But it's still not working.

@garfieldnate
Copy link
Author

I'm sorry, I have no experience writing gradle plugins 🤷 . All my project required was this one simple line: https://github.com/garfieldnate/Weka_AnalogicalModeling/blob/master/build.gradle#L12

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

Successfully merging a pull request may close this issue.

2 participants