From 44c7a38e3d20f7af2ef09f64130f751aa8afb0d9 Mon Sep 17 00:00:00 2001 From: gedoor Date: Fri, 30 Oct 2020 22:27:00 +0800 Subject: [PATCH] encodeURI(str: String, enc: String) --- app/src/main/java/io/legado/app/help/JsExtensions.kt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/src/main/java/io/legado/app/help/JsExtensions.kt b/app/src/main/java/io/legado/app/help/JsExtensions.kt index 0984a01d9..af828e395 100644 --- a/app/src/main/java/io/legado/app/help/JsExtensions.kt +++ b/app/src/main/java/io/legado/app/help/JsExtensions.kt @@ -175,6 +175,14 @@ interface JsExtensions { } } + fun encodeURI(str: String, enc: String): String { + return try { + URLEncoder.encode(str, enc) + } catch (e: Exception) { + "" + } + } + fun htmlFormat(str: String): String { return str.htmlFormat() }