diff options
author | Allan Wang <me@allanwang.ca> | 2020-03-29 19:25:00 -0700 |
---|---|---|
committer | Allan Wang <me@allanwang.ca> | 2020-03-29 19:25:00 -0700 |
commit | a51f349c8682ba26ea28a63b845d80a8c2aeeebf (patch) | |
tree | 53524eedf825717c334cbb8fd9b20e365db76ea2 /app/src/main/kotlin/com/pitchedapps/frost/utils | |
parent | b6e1b70e860773f8040dfe5e70bbd88b6d3c7e7c (diff) | |
download | frost-a51f349c8682ba26ea28a63b845d80a8c2aeeebf.tar.gz frost-a51f349c8682ba26ea28a63b845d80a8c2aeeebf.tar.bz2 frost-a51f349c8682ba26ea28a63b845d80a8c2aeeebf.zip |
Encode url query
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/utils')
-rw-r--r-- | app/src/main/kotlin/com/pitchedapps/frost/utils/Utils.kt | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/utils/Utils.kt b/app/src/main/kotlin/com/pitchedapps/frost/utils/Utils.kt index 6db7179d..a8e7c64c 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/utils/Utils.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/utils/Utils.kt @@ -81,6 +81,8 @@ import org.apache.commons.text.StringEscapeUtils import org.jsoup.Jsoup import org.jsoup.nodes.Document import org.jsoup.nodes.Element +import java.net.URLEncoder +import java.nio.charset.StandardCharsets /** * Created by Allan Wang on 2017-06-03. @@ -370,6 +372,9 @@ val dependentSegments = arrayOf( inline val String?.isExplicitIntent get() = this != null && (startsWith("intent://") || startsWith("market://")) +fun String.urlEncode(): String = + URLEncoder.encode(this, StandardCharsets.UTF_8.name()) + fun Context.frostChangelog() = showChangelog(R.xml.frost_changelog) fun Context.frostUriFromFile(file: File): Uri = |