Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@sherwinski
Copy link
Contributor

@sherwinski sherwinski commented Nov 25, 2019

This PR explicitly converts a query parameter value to UTF-8 before encoding the value to base64. Without specifying the encoding scheme explicitly, the behavior of getBytes() and the subsequent String instantiation would be platform dependent, which can result in incorrectly-encoded values. By specifying UTF-8, we can ensure the results regardless of the default charset of the calling system.
Fixes #35

@sherwinski sherwinski requested a review from jayeb December 2, 2019 21:35
@sherwinski
Copy link
Contributor Author

Hey @spand, I have a fix here for the encoding issue you opened earlier. Feel free to take a look and let me know what you think. Thanks!

@sherwinski sherwinski requested a review from nico256 December 2, 2019 21:40
@sherwinski sherwinski merged commit 3f318a6 into master Dec 3, 2019
@sherwinski sherwinski deleted the get-bytes-utf-8 branch December 3, 2019 21:02
@spand
Copy link

spand commented Dec 4, 2019

Looks good !

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.

URLHelper is calling platform dependent String.getBytes()

4 participants