-
Notifications
You must be signed in to change notification settings - Fork 103
Use consistently the encoding expected by Javadoc for reading and writing of data #1278
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
base: master
Are you sure you want to change the base?
Conversation
…rset mis… (apache#1274)" This reverts commit b453602.
Would be nice to run workflows on this just to know whether it solves what it should solve |
I did not give much thought to the method names or pretty javadoc description. Once we are sure something like this works, I will beautify. |
See: #1274 |
@gnodet what do you think about this one? |
I haven't looked if we cover all the needed calls to files being read or written, but this looks good at first glance. |
what would be the best name for this method? the getDataCharset was nice for the StaleHelper, but more generic would be something like getSystemEncoding or even more accurate getEncodingToUse... I have no idea :/ |
I grepped UTF_8 and then the files that had it, I checked the different calls. If this one passes all the ITs on all platforms, I will have to beautify it and will go through all of the source files looking for usual suspects. |
the version 25 in the matrix brings a dilemma. Groovy 5+ supports JDK11+ until 25, thus does not support JDK8. Groovy 4.x supports JDK8, but does not support JDK25. |
@gnodet there are two occurrences of StandardCharsets.UTF_8 in JavadocUtil.java, but they have nothing to do with the filesystem encoding. In both cases, it is the encoding of maven invokerLog used to convert the byte[] resulting from reading it by Files.readAllBytes into a String. They should be left as they are IMHO. |
And I was overkeen in one place in AbstractJavadocMojo.java where the situation is the same |
b7dbd49
to
a5b547d
Compare
For reading and writing of data, Javadoc does expect a certain encoding dependending on which version of JDK we use. So we have no choice but to actually use that one. Writing only in UTF-8, will always fail in some corner cases.
OK, I cleaned all the stuff and this PR is not WIP any more. I officially request review of this PR. @gnodet |
Following this checklist to help us incorporate your
contribution quickly and easily:
Note that commits might be squashed by a maintainer on merge.
This may not always be possible but is a best-practice.
mvn verify
to make sure basic checks pass.A more thorough check will be performed on your pull request automatically.
mvn -Prun-its verify
).If your pull request is about ~20 lines of code you don't need to sign an
Individual Contributor License Agreement if you are unsure
please ask on the developers list.
To make clear that you license your contribution under
the Apache License Version 2.0, January 2004
you have to acknowledge this by using the following check-box.