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

Fix Eclipse WTP encoding handling #546

Merged
merged 2 commits into from
Mar 26, 2020
Merged

Fix Eclipse WTP encoding handling #546

merged 2 commits into from
Mar 26, 2020

Conversation

fvgh
Copy link
Member

@fvgh fvgh commented Mar 24, 2020

Fixes the WTP encoding handling.
Spotless always provides decoded string to WTP.
The original implementation did not provide any coding descriptions. Hence for HTML, the platform specific one were used. E.g. this affects all WTP clean-up tasks, not only HTML, but whether the others do a second decoding in the first place, has not been checked thoroughly.
Probably they do not.
Anyhow, the changed implementation assures that this part of the code common to all WTP formatters, behaves like that original WTP, though the input files are not directly accessed.

Spotless always provides decoded string to WTP.
@fvgh fvgh requested a review from nedtwigg March 24, 2020 17:17
@fvgh
Copy link
Member Author

fvgh commented Mar 24, 2020

There could be further investigation in how far other formatters are affected by the content descriptors.
But I am afraid, I have no time to do so.

Copy link
Member

@nedtwigg nedtwigg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great except the Charset.defaultCharset() comment. With your permission, I'll make that one single change, verify that the tests still pass, and then publish a new eclipse-wtp.

@fvgh
Copy link
Member Author

fvgh commented Mar 26, 2020

Sorry, need to have another look... Am afraid I never used encoding in depth when working with Java. Find the function description partly misleading.

Java strings are always "decoded" (as UTF-16). This internal code format is transparent to all interfaces.
Encodings/Decodings to/from other formats are only accomplished on byte arrays/streams.
@nedtwigg
Copy link
Member

The fix looks great, thanks!

@nedtwigg nedtwigg merged commit b78fc1b into master Mar 26, 2020
@nedtwigg nedtwigg deleted the eclipse_wtp_encoding branch March 26, 2020 19:30
@nedtwigg
Copy link
Member

I merged to publish, but made a few changes on master before publishing:

eclipse-wtp 3.15.3 is now available on bintray/jcenter, but it is not available on mavencentral. I'm not able to sync, and not sure why. Hopefully it is a transient, I'll try again later today.

@nedtwigg
Copy link
Member

the mavencentral sync has magically resolved. 3.15.3 now available everywhere.

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 this pull request may close these issues.

2 participants