Removed checking for charset, it seems to work without

This commit is contained in:
dankito 2024-10-04 07:05:04 +02:00
parent e4a8a79ee3
commit 1ed96fce7d
1 changed files with 1 additions and 8 deletions

View File

@ -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) {