dispatch / reboot

Scala wrapper for the Java AsyncHttpClient.
https://dispatchhttp.org
GNU Lesser General Public License v3.0
426 stars 105 forks source link

Correctly url encode emoji in path segments #226

Closed farmdawgnation closed 4 years ago

farmdawgnation commented 4 years ago

Closes #213

The previous implementation borked on emoji because invoking char.toString on a single UTF-8 part of a larger UTF-16 pair results in the encoding presenting "?" as the value.

This implementation works primarily on Bytes and avoids having to invoke char.toString and therefore is capable of correctly encoding emoji characters into a UTF-8 url encoded path segment.

This did involve re-working some of the valid character detection for path segments, so there is likely a delta to the overall performance, but I think it should be negligible.