From 7f79735d50820b6ffc6dae76a36306c4cc8fa285 Mon Sep 17 00:00:00 2001 From: M17764017422 <31874069+M17764017422@users.noreply.github.com> Date: Sat, 1 Feb 2020 19:46:14 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=AD=E6=96=87=E4=B9=B1?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复BaseURL模式下部分图片无法加载 --- .../main/java/io/legado/app/ui/rss/read/ReadRssActivity.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/rss/read/ReadRssActivity.kt b/app/src/main/java/io/legado/app/ui/rss/read/ReadRssActivity.kt index 894bed7a9..d0311370c 100644 --- a/app/src/main/java/io/legado/app/ui/rss/read/ReadRssActivity.kt +++ b/app/src/main/java/io/legado/app/ui/rss/read/ReadRssActivity.kt @@ -73,9 +73,9 @@ class ReadRssActivity : VMBaseActivity(R.layout.activity_rss_r val url = NetworkUtils.getAbsoluteURL(it.origin, it.link) val html = viewModel.clHtml(content) if (viewModel.rssSource?.loadWithBaseUrl == true) { - webView.loadDataWithBaseURL(url, html, "text/html", "utf-8", url) + webView.loadDataWithBaseURL(null, html, "text/html", "utf-8", url)//Referer会导致一些有反盗链的图片无法加载,暂时先用null应该还有更好的办法 } else { - webView.loadData(html, "text/html", "utf-8") + webView.loadData(html, "text/html;charset=utf-8", "utf-8")//经测试可以解决中文乱码 } } }) @@ -154,4 +154,4 @@ class ReadRssActivity : VMBaseActivity(R.layout.activity_rss_r } } -} \ No newline at end of file +}