Clarified Android's URI.encode statement

This commit is contained in:
Erik C. Thauvin 2023-01-04 11:40:55 -08:00
parent 3f44a59ff5
commit e20c096cfe

View file

@ -20,7 +20,8 @@ For decades we've been using [java.net.URLEncoder](https://docs.oracle.com/en/ja
Additionally, `java.net.URLEncoder` allocates memory even when no encoding is necessary, significantly impacting performance. This library has a negligible performance impact when the specified string doesn't need to be encoded. Additionally, `java.net.URLEncoder` allocates memory even when no encoding is necessary, significantly impacting performance. This library has a negligible performance impact when the specified string doesn't need to be encoded.
Android's [Uri.encode](https://developer.android.com/reference/android/net/Uri#encode(java.lang.String,%20java.lang.String)) also addresses these issues, but does not currently support [unicode surrogate pairs](https://learn.microsoft.com/en-us/globalization/encoding/surrogate-pairs). Android's [Uri.encode](https://developer.android.com/reference/android/net/Uri#encode(java.lang.String,%20java.lang.String)) also addresses the same issues.
## Examples (TL;DR) ## Examples (TL;DR)
```kotlin ```kotlin