Skip to content

Commit 57d3051

Browse files
authored
Merge branch 'main' into nested-folders-102
2 parents 7aadf34 + 630d7b2 commit 57d3051

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99
- Fixed folders showing up incorrectly as files in copy/move dialog ([#267])
1010
- Fixed error when saving files with unsupported characters ([#250])
1111
- Fixed missing permission prompt on initial "Save as" launch ([#85])
12+
- Fixed printing text files containing a "#" ([#104])
1213
- Fixed cleanup after moving nested folders ([#102])
1314

1415
## [1.2.3] - 2025-09-15
@@ -79,6 +80,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7980
[#267]: https://github.com/FossifyOrg/File-Manager/issues/267
8081
[#250]: https://github.com/FossifyOrg/File-Manager/issues/250
8182
[#85]: https://github.com/FossifyOrg/File-Manager/issues/85
83+
[#104]: https://github.com/FossifyOrg/File-Manager/issues/104
8284
[#102]: https://github.com/FossifyOrg/File-Manager/issues/102
8385

8486
[Unreleased]: https://github.com/FossifyOrg/File-Manager/compare/1.2.3...HEAD

app/src/main/kotlin/org/fossify/filemanager/activities/ReadTextActivity.kt

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import android.net.Uri
77
import android.os.Bundle
88
import android.print.PrintAttributes
99
import android.print.PrintManager
10+
import android.util.Base64
1011
import android.view.inputmethod.EditorInfo
1112
import android.webkit.WebResourceRequest
1213
import android.webkit.WebView
@@ -229,7 +230,17 @@ class ReadTextActivity : SimpleActivity() {
229230
}
230231
}
231232

232-
webView.loadData(binding.readTextView.text.toString(), "text/plain", "UTF-8")
233+
val text = binding.readTextView.text.toString()
234+
ensureBackgroundThread {
235+
try {
236+
val base64 = Base64.encodeToString(text.toByteArray(), Base64.DEFAULT)
237+
runOnUiThread {
238+
webView.loadData(base64, "text/plain", "base64")
239+
}
240+
} catch (e: Exception) {
241+
showErrorToast(e)
242+
}
243+
}
233244
} catch (e: Exception) {
234245
showErrorToast(e)
235246
}

0 commit comments

Comments
 (0)