imgix / imgix-java

A Java client library for generating URLs with imgix
https://www.imgix.com
BSD 2-Clause "Simplified" License
19 stars 8 forks source link

fix: explicitly convert string to UTF-8 byte array #36

Closed sherwinski closed 4 years ago

sherwinski commented 4 years ago

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 commented 4 years ago

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!

spand commented 4 years ago

Looks good !