From e810b343cf4af2db1ae7702a0e315861b2999486 Mon Sep 17 00:00:00 2001 From: arkon Date: Sat, 16 May 2020 15:22:02 -0400 Subject: [PATCH] Specify charset for ZIP chapters when using Android N+ (fixes #905) --- .../eu/kanade/tachiyomi/ui/reader/loader/ZipPageLoader.kt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/loader/ZipPageLoader.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/loader/ZipPageLoader.kt index e2cca59fe9..f65ebc5946 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/loader/ZipPageLoader.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/loader/ZipPageLoader.kt @@ -1,10 +1,12 @@ package eu.kanade.tachiyomi.ui.reader.loader +import android.os.Build import eu.kanade.tachiyomi.source.model.Page import eu.kanade.tachiyomi.ui.reader.model.ReaderPage import eu.kanade.tachiyomi.util.lang.compareToCaseInsensitiveNaturalOrder import eu.kanade.tachiyomi.util.system.ImageUtil import java.io.File +import java.nio.charset.StandardCharsets import java.util.zip.ZipEntry import java.util.zip.ZipFile import rx.Observable @@ -17,7 +19,11 @@ class ZipPageLoader(file: File) : PageLoader() { /** * The zip file to load pages from. */ - private val zip = ZipFile(file) + private val zip = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { + ZipFile(file, StandardCharsets.ISO_8859_1) + } else { + ZipFile(file) + } /** * Recycles this loader and the open zip.