Skip to content

Commit 832bc91

Browse files
author
Jan Guegel
committed
fix change print enconding to base64 #104
Signed-off-by: Jan Guegel <[email protected]>
1 parent 223e644 commit 832bc91

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

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

Lines changed: 4 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,9 @@ 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+
val base64 = Base64.encodeToString(text.toByteArray(), Base64.DEFAULT)
235+
webView.loadData(base64, "text/plain", "base64")
233236
} catch (e: Exception) {
234237
showErrorToast(e)
235238
}

0 commit comments

Comments
 (0)