完成本地书籍编码选择

pull/341/head
gedoor 4 years ago
parent f571b9d176
commit dcce2d864c
  1. 4
      app/src/main/java/io/legado/app/model/localBook/AnalyzeTxtFile.kt

@ -20,7 +20,9 @@ class AnalyzeTxtFile {
@Throws(Exception::class)
fun analyze(book: Book): ArrayList<BookChapter> {
val bookFile = getBookFile(book)
book.charset = EncodingDetect.getEncode(bookFile)
if (book.charset == null) {
book.charset = EncodingDetect.getEncode(bookFile)
}
charset = book.fileCharset()
val rulePattern = if (book.tocUrl.isNotEmpty()) {
Pattern.compile(book.tocUrl, Pattern.MULTILINE)

Loading…
Cancel
Save