From 1ed96fce7d0c2c280303c355e2b3f49cb81fe34c Mon Sep 17 00:00:00 2001 From: dankito Date: Fri, 4 Oct 2024 07:05:04 +0200 Subject: [PATCH] Removed checking for charset, it seems to work without --- .../codinux/banking/ui/service/QrCodeService.android.kt | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/composeApp/src/androidMain/kotlin/net/codinux/banking/ui/service/QrCodeService.android.kt b/composeApp/src/androidMain/kotlin/net/codinux/banking/ui/service/QrCodeService.android.kt index aa57516..3d84357 100644 --- a/composeApp/src/androidMain/kotlin/net/codinux/banking/ui/service/QrCodeService.android.kt +++ b/composeApp/src/androidMain/kotlin/net/codinux/banking/ui/service/QrCodeService.android.kt @@ -103,14 +103,7 @@ class QrCodeImageAnalyzer(private val resultCallback: (QrCodeReadResult) -> Unit val result = reader.decode(bitmap, readerHints) if (result != null && result.text != null) { - val decodeResult = DI.epcQrCodeService.decode(result.text) - if (decodeResult.charset == null || decodeResult.charset == "UTF-8") { - this.resultCallback(QrCodeReadResult(result.text)) - } else { // the charset for receiver name, reference, ... was not UTF-8 -> decode image in EPC QR Code's charset - val resultForEncoding = reader.decode(bitmap, readerHintsForCharset(decodeResult.charset)) - - this.resultCallback(QrCodeReadResult(resultForEncoding?.text ?: result.text)) - } + this.resultCallback(QrCodeReadResult(result.text)) } } catch (e: Throwable) { if (e !is NotFoundException) {